A cache method, device, storage medium and electronic device

By maintaining the cache table in the distributed network and obtaining the data set from the cache node, the problem of the data set being cleared after the container is closed is solved and the efficiency of the training task is improved.

CN118567791BActive Publication Date: 2024-10-22ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411044021.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-10-22
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

During the distributed model training process, the cached training data set is cleared after the container is closed, causing the data set to be re-obtained from the cloud and re-cached, which increases the time consuming of the training task and reduces training efficiency.

Method used

By maintaining a cache table in the distributed network, the path information of the training data set is matched to determine whether it is cached, and the data set is obtained from the cache node to avoid re-acquisition and caching from the cloud.

Benefits of technology

It reduces the time consuming of training tasks, improves training efficiency, and avoids the data set re-acquisition and caching process caused by container shutdown.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567791B_ABST
    Figure CN118567791B_ABST
Patent Text Reader

Abstract

The present specification provides a caching method, device, storage medium and electronic device, which first determine a target container required to execute a distributed model training task, and determine the path information of a target training data set required for a training program in the target container to execute the distributed model training task, and match the path information with each path information contained in a preset cache table to determine whether the target training data set is cached. If so, the node information of the computing node that caches the target training data set is determined from the cache table to obtain the target training data set from the computing node that caches the target training data set, and execute the distributed model training task through the target container. If not, the target training data set is obtained from the cloud according to the path information, so as to execute the distributed model training task through the obtained target training data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a cache method, device, storage medium and electronic device. Background Art

[0002] In recent years, with the rapid development of the computer industry, container technology (such as Docker) has been widely used. For example, container technology can be applied to distributed model training.

[0003] During the distributed model training process, containers can be deployed on each computing node to execute the training program in the container. In addition, training data sets can be obtained from the cloud based on the path information carried by the training program in the container to perform distributed model training.

[0004] At present, in order to solve the time-consuming problem of frequent access to the cloud during training, the training data set can be cached in the container. When the training program in the container needs to obtain the training data set, it can perform training by obtaining the training data set cached in the container.

[0005] However, since the container will be closed when the training task is terminated, that is, the previously cached data will be cleared. Therefore, after the current training task is completed, when executing another training task that needs to obtain the same training data set, since the container has been closed, it is necessary to obtain the training data set from the cloud again, re-cache it, and then perform training after the cache is completed, which increases the time consumption of executing the training task and reduces the efficiency of training. Summary of the invention

[0006] This specification provides a cache method, device, storage medium and electronic device to partially solve the above problems existing in the prior art.

[0007] This manual adopts the following technical solutions:

[0008] This specification provides a caching method, which is applied in a distributed network, wherein the distributed network includes multiple computing nodes, and containers required for executing distributed model training tasks are deployed in at least some of the computing nodes. For each container, the container includes a training program required for executing the distributed model training task, including:

[0009] Determine a target container required to execute the distributed model training task, and determine path information of a target training data set required for a training program in the target container to execute the distributed model training task, wherein the path information is used to represent location information of the target training data set stored in the cloud;

[0010] Matching the path information with each path information contained in a preset cache table to determine whether the target training data set is cached, wherein the cache table is used to characterize the correspondence between the path information of the training data set cached on the computing node in the distributed network and the node information of the computing node that caches the training data set;

[0011] If so, determining the node information of the computing node that caches the target training data set from the cache table, so as to obtain the target training data set from the computing node that caches the target training data set, and executing the distributed model training task through the target container;

[0012] If not, the target training data set is obtained from the cloud according to the path information, so as to execute the distributed model training task through the obtained target training data set.

[0013] Optionally, the method further comprises:

[0014] Determine a target node from each computing node according to the size of free space in a preset cache space of each computing node in the distributed network;

[0015] The target training data set obtained from the cloud is cached in a preset cache space of the target node.

[0016] Optionally, the method further comprises:

[0017] The path information of the target training data set obtained from the cloud and the node information of the target node are correspondingly stored in a preset cache table.

[0018] Optionally, determining the target node from each computing node according to the size of the free space in the preset cache space of each computing node in the distributed network specifically includes:

[0019] Determine a number of candidate nodes from each computing node according to the size of free space in a preset cache space of each computing node in the distributed network;

[0020] For each sub-target training data set contained in the target training data set obtained from the cloud, determine the hash value corresponding to the path information of the sub-target training data set, and determine the target node for caching the sub-target training data set from the candidate nodes based on the hash value and the number of the candidate nodes. The path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

[0021] Optionally, determining the target node from each computing node according to the size of the free space in the preset cache space of each computing node in the distributed network specifically includes:

[0022] For each sub-target training data set contained in the target training data set obtained from the cloud, a computing node corresponding to a container that is pre-set to use the sub-target training data set when executing a distributed model training task is determined as a target node for caching the sub-target training data set.

[0023] Optionally, acquiring the target training data set from the cloud according to the path information specifically includes:

[0024] For each sub-target training data set contained in the target training data set, determine the hash value corresponding to the path information of the sub-target training data set, and determine the computing node used to obtain the sub-target training data set as the acquisition node based on the hash value and the number of target containers required to execute the distributed model training task, and obtain the sub-target training data set from the cloud through the acquisition node. The path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

[0025] Optionally, determining node information of a computing node that caches the target training data set from the cache table to obtain the target training data set from the computing node that caches the target training data set specifically includes:

[0026] In the case where it is determined from the cache table that there are multiple node information of computing nodes that cache the target training data set, for each sub-target training data set contained in the target training data set, a hash value corresponding to the path information of the sub-target training data set is determined, and based on the hash value and the number of computing nodes that cache the target training data set determined from the cache table, the computing node that caches the sub-target training data set is determined to obtain the sub-target training data set from the computing node that caches the sub-target training data set, and the path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

[0027] Optionally, the method further comprises:

[0028] If the time interval from the last acquisition of the training data set is greater than a preset time interval, the training data set is cleared from the computing node that caches the training data set.

[0029] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned cache method is implemented.

[0030] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned cache method when executing the program.

[0031] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0032] A caching method provided in the present specification first determines a target container required to execute a distributed model training task, and determines the path information of a target training data set required for a training program in the target container to execute the distributed model training task, matches the path information with each path information contained in a preset cache table to determine whether the target training data set is cached, and if so, determines the node information of a computing node that caches the target training data set from the cache table to obtain the target training data set from the computing node that caches the target training data set, and executes the distributed model training task through the target container, and if not, obtains the target training data set from the cloud according to the path information, and executes the distributed model training task through the obtained target training data set.

[0033] It can be seen from the above method that the caching method provided in this specification is not to cache in a container like the prior art, but to cache the target training data set in a computing node. When it is determined that the target training data set is cached, the node information of the computing node that caches the target training data set can be determined from the cache table, and the target training data set can be obtained from the corresponding computing node. That is, when the container required to execute the previous model training task is closed, there is no need to re-obtain the training data set from the cloud and re-cache it as in the prior art, but to directly obtain the training data set from the computing node where the training data set is cached for model training, thereby greatly reducing the time consumption of executing the training task and improving the efficiency of training. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0035] Figure 1 A schematic diagram of a caching method provided in this specification;

[0036] Figure 2 A schematic diagram of caching provided in this specification;

[0037] Figure 3 A schematic diagram of caching provided in this specification;

[0038] Figure 4 A schematic diagram of a cache device provided in this specification;

[0039] Figure 5 A method corresponding to the Figure 1 Schematic diagram of the structure of an electronic device. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0041] During the distributed model training process, containers can be deployed on each computing node to execute the training program in the container, and the training data set can be obtained from the cloud based on the path information carried by the training program in the container to perform distributed model training. At present, in order to solve the time-consuming problem caused by frequent access to the cloud during training, the training data set can be cached in the container. When the training program in the container needs to obtain the training data set, it can be trained by obtaining the training data set cached in the container.

[0042] However, since the container will be closed when the training task is terminated, that is, the previously cached data will be cleared. Therefore, after the current training task is completed, when executing another training task that needs to obtain the same training data set, since the container has been closed, it is necessary to obtain the training data from the cloud again, re-cache it, and then perform training after the cache is completed, which increases the time consumption of executing the training task and reduces the efficiency of training.

[0043] To this end, this specification provides a caching method to solve related problems in the prior art.

[0044] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0045] Figure 1 A schematic diagram of a caching method provided in this application includes the following steps:

[0046] S101: Determine a target container required to execute the distributed model training task, and determine path information of a target training data set required for a training program in the target container to execute the distributed model training task, wherein the path information is used to represent location information of the target training data set stored in the cloud.

[0047] The method involved in this specification can be used to perform distributed model training tasks. In actual application, the method can be applied in a distributed network. In a distributed network, multiple computing nodes can be included, wherein at least some of the computing nodes can be deployed with containers required for performing distributed model training tasks, and each container contains a training program required for performing distributed model training tasks.

[0048] The execution subject of the cache method involved in this specification can be any computing node in a distributed network, and the computing node can be an independent unit that can perform training tasks in a distributed network, such as a server. The cache method in the embodiment of this specification is described below with the server as the execution subject.

[0049] In this specification, the server may first determine the target container required to perform the distributed model training task. Also, determine the path information of the target training data set required for the training program in the target container to perform the distributed model training task. Among them, the path information can be used to characterize the location information of the target training data set stored in the cloud. For example, the path information may be the mount path of the target training data set mounted in the target container, and then, the corresponding target training data set may be accessed according to the path corresponding to the mount path in the cloud. For another example, the path information may also be the path where the target training data set is stored in the cloud, and the corresponding target training data set may be accessed according to the path.

[0050] It should be noted that the target training data set in this specification can be in various forms, such as pictures, audio, etc., and this specification does not limit this.

[0051] S102: Match the path information with each path information contained in a preset cache table to determine whether the target training data set is cached, wherein the cache table is used to characterize the correspondence between the path information of the training data set cached on the computing node in the distributed network and the node information of the computing node that caches the training data set.

[0052] After determining the path information of the target training data set required for the training program in the target container to execute the distributed model training task, the server may determine whether the target training data set is cached according to the determined path information.

[0053] Specifically, the server can match the determined path information with each path information contained in a preset cache table to determine whether the target training data set is cached. Among them, the cache table can be used to characterize the correspondence between the path information of the training data set cached on the computing node in the distributed network and the node information of the computing node that caches the training data set. That is, the cache table may contain the path information of the training data set cached on the computing node in the distributed network and the computing node information that caches the training data set, so as to characterize the correspondence between the two. Among them, the node information of the computing node can be used to uniquely identify the computing node. For example, the node information can be the network IP of the computing node.

[0054] In addition, the path information contained in the cache table can be the path in the cloud corresponding to the cached training data set. In practical applications, since the same training data set in the cloud often corresponds to the same mount path when mounted in different containers, the path information contained in the cache table can also be the mount path of the cached training data set mounted in the container. The cache table can be specifically referred to in Table 1 below:

[0055] Table 1

[0056]

[0057] It can be seen from Table 1 that the training data set with path information / A / B is cached on computing node 0, and the training data set with path information / A / D is cached on two computing nodes, namely computing node 0 and computing node 1. Of course, Table 1 is only a form of a cache table. In actual application, the specific content contained in the cache table can be determined according to actual conditions, and this manual will not elaborate on it here.

[0058] S103: If yes, determine the node information of the computing node that caches the target training data set from the cache table, obtain the target training data set from the computing node that caches the target training data set, and execute the distributed model training task through the target container.

[0059] If the determined path information successfully matches each path information contained in the cache table, it is determined that the target training data set is cached.

[0060] Correspondingly, the node information of the computing node that caches the target training data set can be determined from the cache table to obtain the target training data set from the computing node that caches the target training data set.

[0061] It should be noted that the target training dataset may contain multiple sub-target training datasets. For each sub-target training dataset, the path information of the sub-target training dataset can be used to represent the specific location information corresponding to the sub-target training dataset under the location where the target training dataset is stored in the cloud. For example, the path information of the target training dataset a is / A / B, and the target training dataset a contains two sub-target training datasets, namely, sub-target training dataset c and sub-target training dataset d. The path information of sub-target training dataset c can be / A / B / D, and the path information of sub-target training dataset d can be / A / B / F.

[0062] In actual application, each sub-target training data set included in the target training data set may be cached on different computing nodes. Therefore, when each sub-target training data set included in the target training data set is cached on different computing nodes, that is, when there are multiple node information of computing nodes that cache the target training data set determined from the cache table, a method such as hash mapping can be used to determine the computing nodes that cache each sub-target training data set.

[0063] Specifically, for each sub-target training data set included in the target training data set, a hash value corresponding to the path information of the sub-target training data set can be determined. Further, the computing node that caches the sub-target training data set can be determined based on the determined hash value and the number of computing nodes that cache the target training data set determined from the cache table, so as to obtain the sub-target training data set from the computing node that caches the sub-target training data set.

[0064] For example, for the target training dataset M with path information of / C / D, it is determined from the cache table that the target training dataset is cached on two computing nodes, computing node 0 and computing node 1. The target training dataset M contains two sub-target training datasets, namely sub-target training dataset m and sub-target training dataset n. The path information of sub-target training dataset m is / C / D / E, and the path information of sub-target training dataset n is / C / D / W.

[0065] For the sub-target training dataset m, the hash value corresponding to its path information can be determined to be hash( / C / D / E). Since the target training dataset M is cached on two computing nodes, the computing node that caches the sub-target training dataset m can be determined by performing a modulo operation on the hash value corresponding to the path information of the sub-target training dataset m and 2. The result of the modulo operation can be represented by mod(hash( / C / D / E),2). When mod(hash( / C / D / E),2) is 0, it can be determined that the sub-target training dataset m is cached on computing node 0, and the sub-target training dataset m can be obtained from computing node 0. When mod(hash( / C / D / E),2) is 1, it can be determined that the sub-target training dataset m is cached on computing node 1, and the sub-target training dataset m can be obtained from computing node 1.

[0066] For the sub-target training dataset n, the hash value corresponding to its path information can be determined to be hash( / C / D / W). Since the target training dataset M is cached on two computing nodes, the computing node that caches the sub-target training dataset n can be determined by performing a modulo operation on the hash value corresponding to the path information of the sub-target training dataset n and 2. The result of the modulo operation can be represented by mod(hash( / C / D / W),2). When mod(hash( / C / D / W),2) is 1, it can be determined that the sub-target training dataset n is cached on computing node 1, and the sub-target training dataset n can be obtained from computing node 1. When mod(hash( / C / D / W),2) is 0, it can be determined that the sub-target training dataset n is cached on computing node 0, and the sub-target training dataset n can be obtained from computing node 0.

[0067] After obtaining the target training dataset from the computing node that caches the target training dataset, the distributed model training task (such as image classification task, natural language processing task, etc.) can be executed through the target container.

[0068] S104: If not, obtaining the target training data set from the cloud according to the path information, so as to execute the distributed model training task through the obtained target training data set.

[0069] If the path information fails to match the path information contained in the cache table, it is determined that the target training data set is not cached. Then, the target training data set can be obtained from the cloud according to the path information to perform the distributed model training task through the obtained target training data set.

[0070] Specifically, if it is determined that the target training data set is not cached, for each sub-target training data set contained in the target training data set, the hash value corresponding to the path information of the sub-target training data set can be determined first. Then, according to the determined hash value and the number of target containers required to perform the distributed model training task, the computing node for obtaining the sub-target training data set can be determined as the acquisition node, and the sub-target training data set can be obtained from the cloud through the acquisition node.

[0071] For example, the target training dataset M contains two sub-target training datasets, namely sub-target training dataset m and sub-target training dataset n. The path information of sub-target training dataset m is / C / D / E, and the path information of sub-target training dataset n is / C / D / W. The number of target containers required to execute the distributed model training task is 2, namely container 0 and container 1. Container 0 is deployed on computing node 0, and container 1 is deployed on computing node 1.

[0072] If it is determined that the target training dataset M is not cached, for the sub-target training dataset m, the hash value corresponding to its path information can be determined to be hash( / C / D / E). Since the number of target containers required to execute the distributed model training task is 2, the hash value corresponding to the path information of the sub-target training dataset m can be modulo-operated with 2 to determine the computing node that obtains the sub-target training dataset m from the cloud. The result of the modulo operation can be represented by mod(hash( / C / D / E),2). If mod(hash( / C / D / E),2) is 0, it can be determined that the computing node where container 0 is deployed should obtain the sub-target training dataset m from the cloud, that is, the sub-target training dataset m can be obtained through computing node 0.

[0073] For sub-target training dataset n, the hash value corresponding to its path information can be determined to be hash( / C / D / W). Since the number of target containers required to execute the distributed model training task is 2, the hash value corresponding to the path information of sub-target training dataset n can be modulo-operated with 2 to determine the computing node that obtains sub-target training dataset n from the cloud. The result of the modulo operation can be represented by mod(hash( / C / D / W),2). If mod(hash( / C / D / W),2) is 1, it can be determined that the computing node where container 1 is deployed should obtain sub-target training dataset n from the cloud, that is, sub-target training dataset n can be obtained through computing node 1.

[0074] Correspondingly, after obtaining the target training data set, the distributed model training task can be performed using the obtained target training data set.

[0075] Of course, after obtaining the target training data set, the target training data set can also be cached on the computing nodes in the distributed network, so that when the distributed model training task is subsequently executed, the target training data set can be directly obtained from the computing node that caches the target training data set and the distributed model training task can be executed.

[0076] Specifically, each computing node included in the distributed network may be pre-set with a cache space, and the preset cache space may be used to cache the target training data set obtained from the cloud. The server may determine the target node from each computing node based on the size of the free space in the preset cache space of each computing node in the distributed network. Furthermore, the target training data set obtained from the cloud may be cached in the preset cache space of the target node. Accordingly, the server may also save the path information of the target training data set obtained from the cloud and the node information of the target node in a preset cache table, so as to determine whether the target training data set is cached through the cache table during the execution of the distributed model training task.

[0077] In the process of determining the target node, the server may first determine a number of candidate nodes from each computing node according to the size of the free space in the preset cache space of each computing node in the distributed network.

[0078] For example, each computing node can establish a connection with the server, and the server can obtain the size of the free space in the preset cache space of each computing node. If the size of the free space in the preset cache space of the current computing node is not less than the preset minimum space size (such as: 10MB), the current computing node can be used as a candidate node.

[0079] Then, for each sub-target training data set contained in the target training data set obtained from the cloud, the hash value corresponding to the path information of the sub-target training data set can be determined, and based on the determined hash value and the number of candidate nodes, the target node for caching the sub-target training data set can be determined from a number of candidate nodes.

[0080] For example, the target training data set M contains two sub-target training data sets, namely, sub-target training data set m and sub-target training data set n. The path information of sub-target training data set m is / C / D / E, and the path information of sub-target training data set n is / C / D / W. In addition, the number of determined candidate nodes is 4, namely, computing node 0, computing node 1, computing node 2, and computing node 3. For sub-target training data set m, the hash value corresponding to its path information can be determined to be hash( / C / D / E). Since the number of determined candidate nodes is 4, the hash value corresponding to the path information of sub-target training data set m can be modulo-operated with 4 to determine the target node for caching sub-target training data set m from several candidate nodes. The result of the modulo operation can be expressed by mod(hash( / C / D / E), 4). If mod(hash( / C / D / E), 4) is 0, it can be determined that the target node for caching sub-target training data set m is computing node 0. If mod(hash( / C / D / E),4) is 3, it can be determined that the target node for caching the sub-target training data set m is computing node 3.

[0081] For the sub-goal training data set n, the hash value corresponding to its path information can be determined to be hash( / C / D / W). Since the number of determined candidate nodes is 4, the hash value corresponding to the path information of the sub-goal training data set n can be modulo-operated with 4 to determine the target node for caching the sub-goal training data set n from a number of candidate nodes. The result of the modulo operation can be represented by mod(hash( / C / D / W),4). If mod(hash( / C / D / W),4) is 0, it can be determined that the target node for caching the sub-goal training data set m is computing node 0. If mod(hash( / C / D / W),4) is 2, it can be determined that the target node for caching the sub-goal training data set n is computing node 2.

[0082] Of course, in addition to determining the target node in the above manner, for each sub-target training data set contained in the target training data set obtained from the cloud, the computing node corresponding to the container that uses the sub-target training data set when executing the distributed model training task can also be pre-set as the target node for caching the sub-target training data set. For example, the computing node on which the container that uses the sub-target training data set when executing the distributed model training task is deployed can be pre-set as the target node for caching the sub-target training data set. For another example, the acquisition node that obtains the sub-target training data set from the cloud can be pre-set as the target node for caching the sub-target training data set.

[0083] For another example, the computing node corresponding to the acquisition node that acquires the sub-goal training data set can be set as the target node for caching the sub-goal training data set. That is, each acquisition node has a corresponding target node, and when the acquisition node acquires the sub-goal training data set, the acquired sub-goal training data set can be cached on the target node corresponding to the acquisition node according to the preset target node corresponding to the acquisition node.

[0084] Next, the process of obtaining the target training data set and caching it will be further explained. For details, please refer to the following Figure 2 , Figure 3 .

[0085] Figure 2 A schematic diagram of caching provided in this specification.

[0086] Depend on Figure 2 It can be seen that there are two containers required to execute the distributed model training task, namely container 0 and container 1. Container 0 is deployed on computing node 0, and container 1 is deployed on computing node 1. There are four candidate nodes, namely computing node 0, computing node 1, computing node 2, and computing node 3. The target training dataset c stored in the cloud contains two sub-target training datasets, namely sub-target training dataset a and sub-target training dataset b. The path information of sub-target training dataset a is / A / B / C, and the path information of sub-target training dataset b is / A / B / D.

[0087] For the sub-goal training dataset a, the hash value corresponding to its path information is hash( / A / B / C). Since the number of target containers required to execute the distributed model training task is 2, the hash value is modulo 2, and the value of mod(hash( / A / B / C),2) is 1. The sub-goal training dataset a needs to be obtained from the cloud by the computing node deployed by container 1, that is, computing node 1 can obtain the sub-goal training dataset a from the cloud. Then, since the number of candidate nodes is 4, the hash value hash( / A / B / C) corresponding to the path information of the sub-goal training dataset a can be modulo 4, and the value of mod(hash( / A / B / C),4) is 3. In other words, computing node 1 can cache the sub-goal training dataset a obtained from the cloud on computing node 3.

[0088] For the sub-target training dataset b, the hash value corresponding to its path information is hash( / A / B / D). Since the number of target containers required to execute the distributed model training task is 2, the hash value is modulo 2, and the value of mod(hash( / A / B / D),2) is 0. Then, the sub-target training dataset b needs to be obtained from the cloud by the computing node deployed by container 0, that is, computing node 0 can obtain the sub-target training dataset b from the cloud. Then, since the number of candidate nodes is 4, the hash value hash( / A / B / D) corresponding to the path information of the sub-target training dataset b can be modulo 4, and the value of mod(hash( / A / B / D),4) is 0. In other words, computing node 0 can cache the sub-target training dataset b obtained from the cloud on computing node 0, that is, cache it in its own preset cache space.

[0089] Figure 3 A schematic diagram of caching provided in this specification.

[0090] Depend on Figure 3 It can be seen that there are two containers required to execute the distributed model training task, namely container 0 and container 1. Container 0 is deployed on computing node 0, and container 1 is deployed on computing node 1. There are four candidate nodes, namely computing node 0, computing node 1, computing node 2, and computing node 3. The target training data set c stored in the cloud contains two sub-target training data sets, namely sub-target training data set a and sub-target training data set b. The path information of sub-target training data set a is / A / B / C, and the path information of sub-target training data set b is / A / B / D. In addition, it is pre-set that the computing node 0 where container 0 is deployed will cache all the acquired sub-target training data sets on computing node 1, and it is pre-set that the computing node 1 where container 1 is deployed will cache all the acquired sub-target training data sets on computing node 2.

[0091] For sub-goal training data set a, the hash value corresponding to its path information is hash( / A / B / C). Since the number of target containers required to execute the distributed model training task is 2, the hash value is modulo 2, and the value of mod(hash( / A / B / C),2) is 1. Then, the sub-goal training data set a needs to be obtained from the cloud by the computing node deployed by container 1, that is, computing node 1 can obtain sub-goal training data set a from the cloud. Then, since computing node 1 where container 1 is deployed is pre-set to cache all acquired sub-goal training data sets on computing node 2, sub-goal training data set a can be directly cached on computing node 2.

[0092] For sub-goal training data set b, the hash value corresponding to its path information is hash( / A / B / D). Since the number of target containers required to execute the distributed model training task is 2, the hash value is modulo 2, and the value of mod(hash( / A / B / D),2) is 0. Then, the sub-goal training data set b needs to be obtained from the cloud by the computing node deployed by container 0, that is, computing node 0 can obtain sub-goal training data set b from the cloud. Then, since computing node 0 where container 0 is deployed is pre-set to cache all acquired sub-goal training data sets on computing node 1, sub-goal training data set a can be directly cached on computing node 1.

[0093] It should be noted that in this specification, if the time interval from the last acquisition of a training data set on a computing node in a distributed network is greater than a preset time interval (eg, 24 hours), the training data set can be cleared from the computing node that caches the training data set.

[0094] In addition, when determining the hash value corresponding to the path information in this specification, a hash function such as SHA-512, lookup3, etc. can be used to implement it, and this specification does not limit it here.

[0095] It can be seen from the above method that the caching method provided in this specification is not to cache in a container like the prior art, but to cache the target training data set in a computing node. When it is determined that the target training data set is cached, the node information of the computing node that caches the target training data set can be determined from the cache table, and the target training data set can be obtained from the corresponding computing node. That is, when the container required to execute the previous model training task is closed, there is no need to re-obtain the training data set from the cloud and re-cache it as in the prior art, but to directly obtain the training data set from the computing node where the training data set is cached for model training, thereby greatly reducing the time consumption of executing the training task and improving the efficiency of training.

[0096] This specification also provides a cache device, such as Figure 4 shown.

[0097] Figure 4 A cache device provided in this specification includes:

[0098] Determination module 401: used to determine the target container required to execute the distributed model training task, and determine the path information of the target training data set required by the training program in the target container to execute the distributed model training task, wherein the path information is used to represent the location information of the target training data set stored in the cloud;

[0099] Determination module 402: used to match the path information with each path information contained in a preset cache table to determine whether the target training data set is cached, wherein the cache table is used to characterize the correspondence between the path information of the training data set cached on the computing node in the distributed network and the node information of the computing node that caches the training data set;

[0100] The first execution module 403 is used for determining the node information of the computing node that caches the target training data set from the cache table, so as to obtain the target training data set from the computing node that caches the target training data set, and execute the distributed model training task through the target container;

[0101] The second execution module 404 is used to obtain the target training data set from the cloud according to the path information if no, so as to execute the distributed model training task through the obtained target training data set.

[0102] Optionally, the method further includes: a first cache module 405;

[0103] The first cache module 405 is specifically used to: determine a target node from each computing node according to the size of the free space in the preset cache space of each computing node in the distributed network; and cache the target training data set obtained from the cloud in the preset cache space of the target node.

[0104] Optionally, the method further includes: a second cache module 406;

[0105] The second cache module 406 is specifically configured to store the path information of the target training data set obtained from the cloud and the node information of the target node in a preset cache table.

[0106] Optionally, the first cache module 405 is specifically used to: determine a number of candidate nodes from each computing node according to the size of the free space in the preset cache space of each computing node in the distributed network; determine the hash value corresponding to the path information of each sub-target training data set contained in the target training data set obtained from the cloud, and determine the target node for caching the sub-target training data set from the candidate nodes according to the hash value and the number of the candidate nodes, the path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

[0107] Optionally, the first cache module 405 is specifically used to: for each sub-target training data set contained in the target training data set obtained from the cloud, determine the computing node corresponding to the container that is pre-set to use the sub-target training data set when executing the distributed model training task as the target node for caching the sub-target training data set.

[0108] Optionally, the second execution module 404 is specifically used to: determine, for each sub-target training data set contained in the target training data set, a hash value corresponding to the path information of the sub-target training data set, and determine, based on the hash value and the number of target containers required to execute the distributed model training task, a computing node for obtaining the sub-target training data set as an acquisition node, and obtain the sub-target training data set from the cloud through the acquisition node, and the path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

[0109] Optionally, the first execution module 403 is specifically used to: when it is determined from the cache table that there are multiple node information of the computing nodes that cache the target training data set, determine, for each sub-target training data set contained in the target training data set, a hash value corresponding to the path information of the sub-target training data set, and determine the computing node that caches the sub-target training data set based on the hash value and the number of computing nodes that cache the target training data set determined from the cache table, so as to obtain the sub-target training data set from the computing node that caches the sub-target training data set, and the path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

[0110] Optionally, the method further includes: a clearing module 407;

[0111] The clearing module 407 is specifically configured to clear the training data set from the computing node that caches the training data set if the time interval from the last acquisition of the training data set is greater than a preset time interval.

[0112] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A caching method provided.

[0113] This manual also provides Figure 5 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 5As shown, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 A caching method described.

[0114] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0115] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0116] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0117] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0118] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0119] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0124] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0127] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0129] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0130] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A caching method, the method is applied in a distributed network, the distributed network includes multiple computing nodes, at least some of the computing nodes are deployed with containers required for executing distributed model training tasks, for each container, the container includes a training program required for executing the distributed model training task, characterized in that: include: Determine a target container required to execute the distributed model training task, and determine path information of a target training data set required for a training program in the target container to execute the distributed model training task, wherein the path information is used to represent location information of the target training data set stored in the cloud; Matching the path information with each path information contained in a preset cache table to determine whether the target training data set is cached, wherein the cache table is used to characterize the correspondence between the path information of the training data set cached on the computing node in the distributed network and the node information of the computing node that caches the training data set; If so, determining the node information of the computing node that caches the target training data set from the cache table, so as to obtain the target training data set from the computing node that caches the target training data set, and executing the distributed model training task through the target container; If not, then for each sub-target training dataset contained in the target training dataset, determine the hash value corresponding to the path information of the sub-target training dataset, and determine the computing node used to obtain the sub-target training dataset based on the hash value and the number of target containers required to execute the distributed model training task, as the acquisition node, and obtain the sub-target training dataset from the cloud through the acquisition node. The path information of the sub-target training dataset is used to characterize the specific location information corresponding to the sub-target training dataset under the location where the target training dataset is stored in the cloud, so as to execute the distributed model training task through the acquired target training dataset.

2. The method according to claim 1, characterized in that The method further comprises: Determine a target node from each computing node according to the size of free space in a preset cache space of each computing node in the distributed network; The target training data set obtained from the cloud is cached in a preset cache space of the target node.

3. The method according to claim 2, characterized in that The method further comprises: The path information of the target training data set obtained from the cloud and the node information of the target node are correspondingly stored in a preset cache table.

4. The method according to claim 2, characterized in that Determining a target node from each computing node according to the size of free space in a preset cache space of each computing node in the distributed network specifically includes: Determine a number of candidate nodes from each computing node according to the size of free space in a preset cache space of each computing node in the distributed network; For each sub-target training data set contained in the target training data set obtained from the cloud, determine the hash value corresponding to the path information of the sub-target training data set, and determine the target node for caching the sub-target training data set from the candidate nodes based on the hash value and the number of the candidate nodes. The path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

5. The method according to claim 2, characterized in that Determining a target node from each computing node according to the size of free space in a preset cache space of each computing node in the distributed network specifically includes: For each sub-target training data set contained in the target training data set obtained from the cloud, a computing node corresponding to a container that is pre-set to use the sub-target training data set when executing a distributed model training task is determined as a target node for caching the sub-target training data set.

6. The method according to claim 1, characterized in that Determining node information of a computing node that caches the target training data set from the cache table to obtain the target training data set from the computing node that caches the target training data set specifically includes: In the case where it is determined from the cache table that there are multiple node information of computing nodes that cache the target training data set, for each sub-target training data set contained in the target training data set, a hash value corresponding to the path information of the sub-target training data set is determined, and based on the hash value and the number of computing nodes that cache the target training data set determined from the cache table, the computing node that caches the sub-target training data set is determined to obtain the sub-target training data set from the computing node that caches the sub-target training data set, and the path information of the sub-target training data set is used to characterize the specific location information corresponding to the sub-target training data set at the location where the target training data set is stored in the cloud.

7. The method according to claim 1, characterized in that The method further comprises: If the time interval from the last acquisition of the training data set is greater than a preset time interval, the training data set is cleared from the computing node that caches the training data set.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 7 is implemented.