Data cache management and scheduling method, device, electronic device and storage medium
By introducing cache controllers and cache schedulers into large-scale machine learning platforms, custom management and scheduling of cache data sets is solved, and the efficiency and adaptability of resource scheduling is improved.
Patent Information
- Application Number
- CN202111250995.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-10-26
AI Technical Summary
The lack of life cycle management of caches in traditional large-scale machine learning platforms, resulting in the inability to automatically schedule cache resources in deep learning tasks, affecting the efficient execution of tasks.
By introducing cache controllers and cache schedulers into the system, custom management and scheduling of cached data sets are realized. The cache controller creates a cache data set based on user-defined values, while the cache scheduler issues cache resources according to the scheduling policy to realize the full life cycle management of the cache data set.
The automated life cycle management of cache resources is realized, the adaptation relationship between cache and tasks is improved, the efficiency of resource scheduling is enhanced, and the difficulties of manual operation and maintenance are avoided.
Smart Images

Figure CN113961346B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data cache management, and in particular to a data cache management and scheduling method, device, electronic device and storage medium. Background Art
[0002] Currently, the cache of traditional large-scale machine learning platforms built on Kubernetes is not based on lifecycle management; there is no way to have corresponding automated lifecycle management for cache on machine learning platforms like scheduling Kubernetes' own containers; when the platform's deep learning tasks use the cache, they can only be manually assigned to nodes with cache. When ultra-large-scale tasks use the cache at the same time, there is no effective strategy to schedule the adaptation relationship between the cache and the tasks. Summary of the invention
[0003] The present invention provides a data cache management and scheduling method, device, electronic device and storage medium, which can solve the above technical problems.
[0004] The technical solution of the present invention to solve the above technical problems is as follows:
[0005] In a first aspect, an embodiment of the present invention provides a data cache management and scheduling method, which is applied to a system including a cache controller and a cache scheduler, and includes:
[0006] The cluster's API server receives a request from a user to create a cached dataset;
[0007] The cache controller listens to the request for creating a cache data set task, and calls the callback function to create the cache data set according to the user-defined value;
[0008] The cache scheduler receives the request to create a cache data set, and sends the cache data set according to the corresponding scheduling strategy, and the cache data set is successfully created;
[0009] User-defined values include: the capacity of the cached dataset, the status of the cached dataset, and the data path of the underlying storage of the cached dataset.
[0010] Furthermore, the data cache management and scheduling method further includes:
[0011] The API-server of the cluster receives a task creation request submitted by a user with the cache data set;
[0012] The cluster's native controller receives the task creation request;
[0013] The cache scheduler sends resources to nodes based on the cache data set information, pod creation information, node information, and corresponding scheduling policy information;
[0014] The agent creates tasks on the nodes.
[0015] Furthermore, the data cache management and scheduling method further includes:
[0016] The cache scheduler obtains the cache data set information and node information from the API server of the cluster;
[0017] The information of the cached data set includes: the capacity of the cached data set, the status of the cached data set, and the data path of the underlying storage of the cached data set; the information of the node includes: the total memory size of each machine of the node itself and the size of the allocatable memory;
[0018] The cache data set information and node information are placed in the Cache.
[0019] Furthermore, in the above data cache management and scheduling method,
[0020] The cache scheduler contains a session module. The session module determines the appropriate node based on the cluster's scheduling strategy and the current cluster information, binds resources to the node name, and calls the node's own agent to create resources.
[0021] Furthermore, in the above data cache management and scheduling method:
[0022] The scheduling strategy is loaded into the cache scheduler in the form of a plug-in. When using it, the user specifies the name of the scheduling strategy, and the cache scheduler will automatically select the corresponding scheduling strategy to schedule resources.
[0023] Furthermore, the data cache management and scheduling method further includes:
[0024] The cache controller receives a request from a user to update or delete the cache data set, and updates or deletes the cache data set;
[0025] Furthermore, the data cache management and scheduling method further includes:
[0026] The cache controller automatically maintains the life cycle of the cache data set.
[0027] In a second aspect, an embodiment of the present invention further provides a data cache management and scheduling device, which is applied to a system including a cache controller and a cache scheduler, including:
[0028] Receiving module: The API server for the cluster receives the user's request to create a cached dataset;
[0029] Creation module: the cache controller listens to the request for creating the cache data set task, and calls the callback function to create the cache data set according to the user-defined value;
[0030] Sending module: The cache scheduler receives a request to create a cache data set, sends the cache data set according to the corresponding scheduling strategy, and the cache data set is created successfully;
[0031] User-defined values include: the capacity of the cached dataset, the status of the cached dataset, and the data path of the underlying storage of the cached dataset.
[0032] In a third aspect, an embodiment of the present invention further provides an electronic device, including: a processor and a memory;
[0033] The processor is used to execute any of the data cache management and scheduling methods described above by calling the program or instruction stored in the memory.
[0034] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute a data cache management and scheduling method as described in any one of the above items.
[0035] The beneficial effects of the present invention are as follows: the present invention relates to a data cache management and scheduling method, device, electronic device and storage medium, the method is applied to a system including a cache controller and a cache scheduler, including: the API-server of the cluster receives a user's request to create a cache data set; the cache controller listens to the request to create a cache data set task, and calls a callback function to create the cache data set according to a user-defined value; the cache scheduler receives the request to create a cache data set, and sends the cache data set according to a corresponding scheduling policy, and the cache data set is successfully created. This application manages cache data as a custom resource of the cluster, so that the cache can be monitored and controlled, and achieves full life cycle management. Through the cache scheduler, users can access more scheduling policies, have more abundant means in cache management, and can adapt to more complex scenarios; it makes resource scheduling more efficient and avoids the problem of manual operation and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A data cache management and scheduling method provided by an embodiment of the present invention Figure 1 ;
[0037] Figure 2A data cache management and scheduling method provided by an embodiment of the present invention Figure 2 ;
[0038] Figure 3 A diagram of a data cache management and scheduling device provided by an embodiment of the present invention;
[0039] Figure 4 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0041] In order to more clearly understand the above-mentioned purpose, features and advantages of the present application, the present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is to be understood that the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. The specific embodiments described herein are merely used to explain the present disclosure, rather than to limit the present application. All other embodiments obtained by those of ordinary skill in the art according to the described embodiments of the present application belong to the scope of protection of the present application.
[0042] It should be noted that, in this document, relational terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any actual relationship or order between these entities or operations.
[0043] Figure 1 A data cache management and scheduling method provided by an embodiment of the present invention Figure 1 .
[0044] In a first aspect, an embodiment of the present invention provides a data cache management and scheduling method, which is applied to a system including a cache controller and a cache scheduler, and includes three steps S101 to S103:
[0045] S101: The API server of the cluster receives a request from a user to create a cache data set.
[0046] Specifically, in an embodiment of the present application, a custom resource such as a cached dataset is registered in Kubernetes, and when a subsequent user creates a resource such as a cached dataset, the cluster's API server can perceive the user's creation request.
[0047] S102: The cache controller monitors a request for creating a cache data set task, and calls a callback function according to a user-defined value to create the cache data set.
[0048] Specifically, in an embodiment of the present application, the user-defined value can be a field of a cache resource, such as the capacity of a cache data set, the status of a cache data set such as cache initialization, cache synchronization, cache completion, the data path of the cache's underlying storage, etc.; the cache data controller customizes polling of external resource request events, such as a user's cache data set creation request, and then calls a callback function inside the controller to create a cache data set. The callback function calls the API interfaces of various cache engines to obtain data from the underlying storage to cache the memory or SSD of a certain node.
[0049] S103: The cache scheduler receives the request to create a cache data set, and sends the cache data set according to the corresponding scheduling policy. The cache data set is created successfully.
[0050] Specifically, in the embodiment of the present application, through the extended cache scheduler, the user can access more scheduling strategies, have richer means for cache management, can adapt to more complex scenarios, and successfully create a cache data set.
[0051] Figure 2 A data cache management and scheduling method provided by an embodiment of the present invention Figure 2 .
[0052] Furthermore, combined with Figure 2 The above data cache management and scheduling method further includes four steps S201 to S204:
[0053] S201: The API server of the cluster receives a task creation request submitted by a user with the cache data set.
[0054] Specifically, in an embodiment of the present application, a user submits a training task with a cached data set such as T, and the API server receives the task creation request.
[0055] S202: The native controller of the cluster receives a request to create a task.
[0056] Specifically, in the embodiment of the present application, the native controller of the cluster can perceive the request for task creation.
[0057] S203: The cache scheduler sends resources to the node according to the cache data set information, pod creation information, node information, and corresponding scheduling policy information.
[0058] Specifically, in an embodiment of the present application, the cache scheduler will distribute resources according to the corresponding strategy based on the corresponding information of the cached data set in the cache, the creation information of the pod, and the information of the node resources, and distribute the resources to the corresponding nodes, such as directly scheduling them to the node with the cached data set.
[0059] S204: The agent creates a task at the node.
[0060] Specifically, in an embodiment of the present application, after a task is scheduled by a cache scheduler, the cache scheduler will select a most suitable node for the resource, and a creation request will be sent to the node's agent. The agent receives the creation request, calls the node's own resources, creates a corresponding task, and reads the cache data to start model training.
[0061] Furthermore, the data cache management and scheduling method further includes:
[0062] The cache scheduler obtains the cache data set information and node information from the API server of the cluster.
[0063] The information of the cached data set includes: the capacity of the cached data set, the status of the cached data set, and the data path of the underlying storage of the cached data set; the information of the node includes: the total memory size of each machine of the node itself and the size of the allocatable memory.
[0064] The cache data set information and node information are placed in the Cache.
[0065] Specifically, in an embodiment of the present application, the cache scheduler pulls information of a custom cache data set from an API-server; the pulled cache data set information such as the cache data set size, the data path of the cache data set, etc. and the node information and the total memory size of each machine of the node itself, the size of the allocatable memory, etc. are all placed in the Cache.
[0066] Furthermore, in the above data cache management and scheduling method,
[0067] The cache scheduler contains a session module. The session module determines the appropriate node based on the cluster's scheduling strategy and the current cluster information, binds resources to the node name, and calls the node's own agent to create resources.
[0068] Specifically, in the embodiment of the present application, there is a session module in the controller, and the session module is responsible for completing the policy scheduling. For example, if a user wants to implement Bingpack, the scheduling strategy will give priority to caching data on full machines, leaving machines with sufficient memory for scheduling other tasks; the process of the session module is to select a suitable node based on the cluster scheduling strategy and the current cluster information, bind the resources to the node name, and then call the node's own agent to create resources.
[0069] Furthermore, in the above data cache management and scheduling method:
[0070] The scheduling strategy is loaded into the cache scheduler in the form of a plug-in. When using it, the user specifies the name of the scheduling strategy, and the cache scheduler will automatically select the corresponding scheduling strategy to schedule resources.
[0071] Specifically, in the embodiment of the present application, the scheduling strategy is loaded on the cache scheduler in the form of a plug-in. When the user wants to use it, he only needs to specify the name of the scheduling strategy. When the cache scheduler schedules, it will automatically select the corresponding strategy to schedule resources, making resource scheduling more efficient and avoiding the problem of manual operation and maintenance.
[0072] Furthermore, the data cache management and scheduling method further includes:
[0073] The cache controller receives a user's request to update or delete the cache data set, and updates or deletes the cache data set.
[0074] Specifically, in the embodiment of the present application, the management of operations such as updating and deleting of cached data sets can also be achieved through operations such as updating and deleting.
[0075] Furthermore, the data cache management and scheduling method further includes:
[0076] The cache controller automatically maintains the life cycle of the cache data set.
[0077] Specifically, in an embodiment of the present application, the cache controller will automatically maintain the life cycle of the entire cache data set. For example, when a user needs to expand the cache capacity, the controller will call the corresponding API to expand the underlying cache.
[0078] Figure 3 A diagram of a data cache management and scheduling device provided in an embodiment of the present invention.
[0079] In a second aspect, an embodiment of the present invention further provides a data cache management and scheduling device, which is applied to a system including a cache controller and a cache scheduler, and is combined with Figure 3 ,include:
[0080] Receiving module 301: The API-server for the cluster receives a request from a user to create a cache data set.
[0081] Specifically, in the embodiment of the present application, a custom resource such as a cached dataset is registered in Kubernetes. When a subsequent user creates a resource such as a cached dataset, the receiving module 301 in the API server of the cluster can perceive the user's creation request.
[0082] Creation module 302: The cache controller monitors the request for creating the cache data set task, and calls the callback function to create the cache data set according to the user-defined value.
[0083] Specifically, in an embodiment of the present application, the user-defined value can be a field of a cache resource, such as the capacity of a cache data set, the status of a cache data set such as cache initialization, cache synchronization, cache completion, the data path of the cache's underlying storage, etc.; the cache data controller customizes polling of external resource request events, such as a user's cache data set creation request, and then calls the creation module 302 in the callback function inside the controller to create a cache data set. The callback function will call the API interfaces of various cache engines to obtain data from the underlying storage to cache the memory or SSD of a certain node.
[0084] Sending module 303: The cache scheduler receives the request to create a cache data set, sends the cache data set according to the corresponding scheduling strategy, and the cache data set is created successfully.
[0085] Specifically, in an embodiment of the present application, through an extended cache scheduler, the sending module 303 can send the cache data set according to the corresponding scheduling strategy, so that the user can access more scheduling strategies, have richer means in cache management, adapt to more complex scenarios, and successfully create a cache data set.
[0086] In a third aspect, an embodiment of the present invention further provides an electronic device, including: a processor and a memory;
[0087] The processor is used to execute any of the data cache management and scheduling methods described above by calling the program or instruction stored in the memory.
[0088] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute a data cache management and scheduling method as described in any one of the above items.
[0089] Figure 4 It is a schematic block diagram of an electronic device provided by an embodiment of the present disclosure.
[0090] like Figure 4As shown, the electronic device includes: at least one processor 401, at least one memory 402 and at least one communication interface 403. The various components in the electronic device are coupled together through a bus system 404. The communication interface 403 is used to transmit information between external devices. It can be understood that the bus system 404 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 404 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 4 Various buses are labeled as bus system 404 .
[0091] It can be understood that the memory 402 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.
[0092] In some implementations, the memory 402 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and application programs.
[0093] Among them, the operating system includes various system programs, such as the framework layer, the core library layer, the driver layer, etc., which are used to implement various basic services and process tasks based on hardware. The application program includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. A program that implements any method of a data cache management and scheduling method provided in an embodiment of the present application can be included in the application program.
[0094] In an embodiment of the present application, the processor 401 calls a program or instruction stored in the memory 402, specifically, a program or instruction stored in an application, and the processor 401 is used to execute the steps of each embodiment of a data cache management and scheduling method provided in an embodiment of the present application.
[0095] The cluster's API server receives a request from a user to create a cached dataset;
[0096] The cache controller listens to the request for creating a cache data set task, and calls the callback function to create the cache data set according to the user-defined value;
[0097] The cache scheduler receives the request to create a cache data set, and sends the cache data set according to the corresponding scheduling strategy, and the cache data set is successfully created;
[0098] User-defined values include: the capacity of the cached dataset, the status of the cached dataset, and the data path of the underlying storage of the cached dataset.
[0099] Any of the methods for managing and scheduling a data cache provided in an embodiment of the present application can be applied to the processor 401, or implemented by the processor 401. The processor 401 can be an integrated circuit chip having signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 401 or instructions in the form of software. The above-mentioned processor 401 can be a general-purpose processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0100] The steps of any method in a data cache management and scheduling method provided in an embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software units in a decoding processor. The software unit can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402, and completes the steps of a data cache management and scheduling method in combination with its hardware.
[0101] Those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present application and to form different embodiments.
[0102] Those skilled in the art will appreciate that the description of each embodiment has its own emphasis, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0103] Although the embodiments of the present application have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.
[0104] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A data cache management and scheduling method, characterized in that: Applicable to a system including a cache controller and a cache scheduler, including: The cluster's API server receives a request from a user to create a cached dataset; The cache controller monitors the request to create a cache data set, and calls a callback function to create the cache data set according to a user-defined value; The cache scheduler receives the request to create the cache data set, issues the cache data set according to the corresponding scheduling strategy, and the cache data set is created successfully; The user-defined values include: the capacity of the cache data set, the state of the cache data set, and the data path of the underlying storage of the cache data set.
2. The data cache management and scheduling method according to claim 1, characterized in that: The above method further includes: The API-server of the cluster receives a task creation request submitted by a user with the cache data set; The native controller of the cluster receives the creation request of the task; The cache scheduler sends resources to the node according to the cache data set information, pod creation information, node information and corresponding scheduling strategy information; The agent creates the task at the node.
3. The data cache management and scheduling method according to claim 2, characterized in that: The method further comprises: The cache scheduler obtains the information of the cache data set and the information of the node from the API-server of the cluster; The information of the cache data set includes: the capacity of the cache data set, the state of the cache data set, and the data path of the underlying storage of the cache data set; The node information includes: the total memory size of each machine in the node itself and the size of the allocatable memory; The information of the cache data set and the information of the node are both placed in the Cache.
4. The data cache management and scheduling method according to claim 1, characterized in that: The cache scheduler includes a session module, which determines the appropriate node according to the cluster scheduling strategy and the current cluster information, binds the resource to the node name, and calls the node's own agent to create the resource.
5. The data cache management and scheduling method according to claim 1, characterized in that: The scheduling strategy is loaded into the cache scheduler in the form of a plug-in. When using it, the user specifies the name of the scheduling strategy, and the cache scheduler will automatically select the corresponding scheduling strategy to schedule resources.
6. The data cache management and scheduling method according to claim 1, characterized in that: The method further comprises: The cache controller receives a request from a user to update or delete the cache data set. Update or delete the cached data set; 7. The data cache management and scheduling method according to claim 1, characterized in that: The method further includes: a cache controller automatically maintaining the life cycle of the cache data set.
8. A data cache management and scheduling device, characterized in that: Applicable to a system including a cache controller and a cache scheduler, including: Receiving module: The API server for the cluster receives the user's request to create a cached dataset; Creation module: the cache controller listens to the request to create a cache data set, and calls the callback function to create the cache data set according to the user-defined value; Sending module: The cache scheduler receives the request to create the cache data set, sends the cache data set according to the corresponding scheduling strategy, and the cache data set is created successfully; The user-defined values include: the capacity of the cached dataset, the status of the cached dataset, and the data path of the underlying storage of the cached dataset.
9. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute a data cache management and scheduling method as described in any one of claims 1 to 7 by calling a program or instruction stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a data cache management and scheduling method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for efficient grouping of cache requests for datapath scheduling
CN110827384A
Computer server application execution scheduling latency reduction
US20190179678A1