Task scheduling method, distributed system, electronic device, and storage medium
By using a scheduling device in a distributed system, tasks are allocated to local and remote computing nodes for processing based on resource availability, thus solving the problem of insufficient local computing node resources and improving task processing efficiency.
Patent Information
- Application Number
- CN202211216312.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Insufficient resources on local computing nodes lead to a high failure rate in task processing or long task queuing times, making it impossible to effectively support the computing needs of large-scale batch tasks.
The scheduling device in the distributed system schedules tasks to local computing nodes and target remote computing nodes for parallel processing based on the available resources of local and remote computing nodes, thus utilizing computing resources from multiple regions for task allocation.
It alleviated the problem of insufficient local computing node resources, improved task processing efficiency, and reduced task processing failure rate and queuing time.
Smart Images

Figure CN115421926B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of data processing technology, and more particularly to a task scheduling method, a distributed system, an electronic device, and a storage medium. Background Technology
[0002] Computing scenarios such as autonomous driving, biological computing, and high-performance simulation require substantial computing resources to support large-scale batch tasks. In related technologies, batch tasks are typically scheduled and run on local computing nodes (such as local computing data centers). However, the computing resources in a single-region computing node are often insufficient to support the high computing resource demands of large-scale batch tasks, resulting in high task failure rates or long task queuing times. Summary of the Invention
[0003] In view of the above, one or more embodiments of this specification provide a task scheduling method, a distributed system, an electronic device, and a storage medium.
[0004] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a task scheduling method for a distributed system is proposed. The distributed system includes a plurality of computing nodes and a plurality of scheduling devices. The plurality of computing nodes are distributed across multiple regions, and the plurality of scheduling devices correspond one-to-one with each of the multiple regions and are respectively distributed in each region. The method is applied to any one of the scheduling devices. The method includes:
[0006] In response to a task scheduling request, determine several tasks to be scheduled;
[0007] Based on the inventory of operating resources of the local computing node and the inventory of operating resources of the remote computing node, some of the tasks are scheduled to be processed on the local computing node, and another part of the tasks are scheduled to be processed on the target remote computing node.
[0008] The local computing node is a computing node located in the same region as the scheduling device, the remote computing node is a computing node located in a different region from the scheduling device, and the target remote computing node is a determined remote computing node used to process the other part of the task.
[0009] According to a second aspect of one or more embodiments of this specification, a distributed system is proposed, including a plurality of computing nodes and a plurality of scheduling devices, wherein the plurality of computing nodes are distributed in multiple regions, and the plurality of scheduling devices correspond one-to-one with the plurality of regions and are distributed in each region respectively; any one of the scheduling devices is used to execute the method described in the first aspect; any one of the computing nodes is used to process the tasks scheduled for this node.
[0010] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, comprising:
[0011] processor;
[0012] Memory used to store instructions that can be processed by the processor;
[0013] The processor implements the method as described in the first aspect by executing the processable instructions.
[0014] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when processed by a processor, implement the steps of the method as described in the first aspect.
[0015] The task scheduling method, distributed system, electronic device, and storage medium provided in the embodiments of this specification have the following beneficial effects:
[0016] When a scheduling device in a certain region receives a task scheduling request initiated by a client, it can determine several tasks to be scheduled. Then, based on the available resources of the local computing node and the available resources of the remote computing node, it can schedule some of the tasks to the local computing node for processing and schedule the other part of the tasks to the target remote computing node for processing. This can alleviate the problem of high task failure rate or long task queuing time caused by insufficient resources of the local computing node, and improve task processing efficiency. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the structure of a distributed system provided in an exemplary embodiment.
[0018] Figure 2 This is a flowchart illustrating a task scheduling method provided in an exemplary embodiment.
[0019] Figure 3 This is a schematic diagram illustrating the application for loading resources provided in an exemplary embodiment.
[0020] Figure 4 This is an exemplary embodiment of an execution timing diagram of a scheduling device, a local computing node, and a target computing node in a distributed system.
[0021] Figure 5 This is a flowchart illustrating another task scheduling method provided in an exemplary embodiment.
[0022] Figure 6 This is an execution timing diagram of a scheduling device, a local computing node, and a target computing node in another distributed system provided by an exemplary embodiment.
[0023] Figure 7 This is a schematic diagram illustrating the decomposition of a task into multiple subtasks, provided in an exemplary embodiment.
[0024] Figure 8 This is a schematic diagram of the structure of a scheduling device provided in an exemplary embodiment.
[0025] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an exemplary embodiment. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0027] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0028] This specification provides an embodiment of a distributed system, which includes several computing nodes and multiple scheduling devices. The computing nodes and multiple scheduling devices are communicatively connected. Each computing node is a computing device capable of independently processing a certain transaction. The computing device can be a physical device or a virtual machine.
[0029] For example, the computing node includes a processor and a memory. The computing node can read the corresponding computer program from the memory to run. During the execution of the computer program, the processor may also need to read relevant data from the memory to participate in the calculation according to the operation logic indicated by the computer program.
[0030] The plurality of computing nodes are distributed across multiple regions, and the plurality of scheduling devices correspond one-to-one with each of the multiple regions and are distributed in each region respectively. To address the problems in related technologies, embodiments of this specification provide a task scheduling method, which can be executed by a scheduling device located in any region. For ease of distinction, for any scheduling device, computing nodes located in the same region as the scheduling device are called local computing nodes, and computing nodes located in different regions are called remote computing nodes. For example, please refer to... Figure 1 For the scheduling device in region A, the three computing nodes located in region A are local computing nodes, while the computing nodes located in regions B and C are remote computing nodes. It is understood that this embodiment does not impose any limitation on the number of computing nodes in the same region; there can be one, two, or more.
[0031] To address the problems in related technologies, embodiments of this specification provide a task scheduling method. When a scheduling device in a certain region receives a task scheduling request initiated by a client, it can determine several tasks to be scheduled. Then, based on the available resources of the local computing node and the available resources of the remote computing node, it schedules some of the tasks to the local computing node for processing and schedules another portion of the tasks to a target remote computing node for processing. This alleviates the problem of high task processing failure rate or long task queuing time caused by insufficient resources of the local computing node, thereby improving task processing efficiency. The target remote computing node is a determined remote computing node used to process the other portion of the tasks.
[0032] It is understood that the scheduling device can be a hardware product or a software product. If the scheduling device is a physical device with computing capabilities, it can communicate and connect with other computing nodes. If the scheduling device is a software product, it can be integrated into a device with computing capabilities; for example, a scheduling device distributed in a certain region can be integrated into one of the computing nodes in that region.
[0033] In an exemplary application scenario, such as in an autonomous driving scenario, specifically in region A, the map of that region needs to be updated based on continuously collected road data to ensure the safety of autonomous driving. The client can initiate a request to the scheduling device in region A to update the map of region A based on the continuously increasing road data collected. For example, region A includes several roads, thus correspondingly there are several map update tasks for different roads. The scheduling device in region A can then apply the task scheduling method provided in the embodiments of this specification to schedule some of the map update tasks to local computing nodes for processing, and schedule another part of the map update tasks to target remote computing nodes for processing, thereby improving task processing efficiency.
[0034] Furthermore, large-scale batch task computational needs also exist in scenarios such as biological computing, high-performance simulation, and finance. For example, in financial scenarios, operations research optimization methods are often applied to financial risk control and management, asset valuation and management, and pricing analysis. Suppose in a financial lending scenario, users typically need to apply for loans from banks, and the banks determine the loan amount for each user based on their risk level. Assuming there are 200 million users applying for loans from 10 banks, and the optimization objective is to maximize the approved loan amount for each user, a total of 2 billion decision variables need to be solved (determining how much loan each bank approves for each user). To solve this operations research optimization task, one approach is to decompose the large-scale operations research optimization task into several parallel subtasks. Each subtask solves a subset of decision variables, ensuring that the coefficient distribution of each subtask is consistent, for example, by having the same type of constraints. After the client initiates a processing request for the operations optimization task to the scheduling device in a certain region, the scheduling device can apply the task scheduling method provided in the embodiments of this specification to schedule some subtasks of the operations optimization task to local computing nodes for processing, and schedule another part of the subtasks of the operations optimization task to target remote computing nodes for processing, so as to improve task processing efficiency.
[0035] The task scheduling method provided in the embodiments of this specification will be described by way of example below: Please refer to Figure 2 , Figure 2 A flowchart illustrating a task scheduling method for a distributed system is shown. The distributed system includes several computing nodes and multiple scheduling devices. The computing nodes are distributed across multiple regions, and the multiple scheduling devices correspond one-to-one with each of the multiple regions and are distributed in each region. The method is applied to any one of the scheduling devices. The method includes:
[0036] In step S101, in response to a task scheduling request, several tasks to be scheduled are determined.
[0037] In step S102, based on the inventory of operating resources of the local computing node and the inventory of operating resources of the remote computing node, some of the tasks are scheduled to be processed on the local computing node, and another part of the tasks are scheduled to be processed on the target remote computing node; wherein, the local computing node is a computing node located in the same region as the scheduling device, the remote computing node is a computing node located in a different region from the scheduling device, and the target remote computing node is a determined remote computing node used to process the other part of the tasks.
[0038] This embodiment enables the parallel processing of several tasks by scheduling them to local computing nodes and target remote computing nodes, thereby alleviating the problem of high task failure rates or long task queuing times caused by insufficient resources on local computing nodes and improving task processing efficiency.
[0039] For example, the tasks may be independent tasks of the same type, and / or tasks decomposed from a large-scale task. In other words, the tasks have the same processing logic, but the data they process differs.
[0040] In one example, such as in an autonomous driving scenario, if the task to be processed is to update the road map, then the data involved in the calculation during the task processing is road data (such as road location information, environmental information around the road, etc.).
[0041] In some embodiments, the target off-site computing node is a subset or all of all off-site computing nodes.
[0042] For example, target off-site computing nodes for processing tasks can be determined based on the inventory of operating resources of the off-site computing nodes. For instance, off-site computing nodes with an inventory of operating resources greater than or equal to a preset threshold are identified as target off-site computing nodes, while off-site computing nodes with an inventory of operating resources less than the preset threshold are excluded. The preset threshold can be dynamically determined based on the inventory of operating resources of the local computing nodes. For example, the preset threshold is positively correlated with the inventory of operating resources of the local computing nodes. That is, the more operating resources a local computing node has, the more tasks can be scheduled to be processed on the local computing node. Accordingly, the preset threshold can be set larger, selecting only a smaller number of target off-site computing nodes. Conversely, the less operating resources a local computing node has, the fewer tasks can be scheduled to be processed on the local computing node. Accordingly, the preset threshold can be set smaller, selecting a larger number of target off-site computing nodes.
[0043] For example, the target remote computing node for processing tasks can be determined based on the inventory of operating resources of the remote computing node and the distance between the region where the remote computing node is located and the region where the scheduling device is located. For instance, remote computing nodes with an inventory of operating resources greater than or equal to a preset threshold and a distance less than a preset distance threshold can be identified as target remote computing nodes. Closer distances result in faster data transmission rates, and higher inventory of operating resources leads to higher task processing efficiency.
[0044] It is understandable that during task scheduling, the inventory of computing node resources changes dynamically with time and operating conditions. Therefore, the process of selecting a target off-site computing node can be performed periodically during task scheduling, and this embodiment does not impose any restrictions on this.
[0045] For example, the target remote computing node can also be a remote computing node pre-selected by the user through the client to process tasks. For example, the target remote computing node can also be all remote computing nodes in the distributed system by default. For example, the target remote computing node can also be a subset of remote computing nodes randomly selected from all remote computing nodes in the distributed system. This embodiment does not impose any limitations in this regard.
[0046] In some embodiments, computing nodes need to acquire relevant data to participate in computation during task processing. For example, in autonomous driving scenarios, the task required for processing road update tasks is road data (such as road location information, surrounding environmental information, etc.). Considering that before initiating a task scheduling request, the client generally stores the incremental data needed during the task process into the data set corresponding to the several tasks to meet the execution requirements of the several tasks, before scheduling the several tasks, the scheduling device can respond to the storage event of incremental data in the data set corresponding to the several tasks, update the metadata of the data set, and then synchronously cache the updated metadata to the local computing node and the target remote computing node, so that the local computing node and the target remote computing node can read the data participating in the computation based on the metadata during task processing. The metadata is data about data describing the data participating in the computation, mainly describing data properties to support functions such as indicating storage location, historical data, resource lookup, or file records. Only after the metadata synchronization is completed is it allowed to schedule the tasks to be processed to be executed on the local computing node and the target remote computing node, which is beneficial to improving task processing efficiency.
[0047] Of course, the client may also store incremental data into the dataset during task processing, and the metadata of the dataset will be updated accordingly. The scheduling device can then respond to the metadata update event by synchronously caching the updated metadata to both the local computing node and the target remote computing node to ensure accurate task processing on both nodes.
[0048] In some embodiments, during task scheduling, the availability of runtime resources on computing nodes is considered to dynamically change with time and operating conditions. The scheduling device can monitor the availability of runtime resources on the local computing node and the availability of runtime resources on the target remote computing node. In response to a non-zero availability of runtime resources on the local computing node, a portion of the tasks is scheduled to be processed on the local computing node based on the real-time availability of runtime resources on the local computing node; and in response to a non-zero availability of runtime resources on the target remote computing node, another portion of the tasks is scheduled to be processed on the target remote computing node based on the real-time availability of runtime resources on the target remote computing node.
[0049] The number of tasks scheduled to be processed on the local computing node is positively correlated with the amount of runtime resources available on that local computing node; that is, the more runtime resources available on the local computing node, the more tasks will be scheduled to be processed on that local computing node, and vice versa. Similarly, the number of tasks scheduled to be processed on the target remote computing node is also positively correlated with the amount of runtime resources available on the target remote computing node; that is, the more runtime resources available on the target remote computing node, the more tasks will be scheduled to be processed on that target remote computing node, and vice versa.
[0050] In some embodiments, computing nodes need to acquire relevant data to participate in computation during task processing. For example, in autonomous driving scenarios, the task required to process road update tasks is road data (such as road location information, environmental information around the road, etc.). Therefore, it is also necessary to determine the data set corresponding to several tasks to be scheduled. The data set is generally stored on the local computing node or on a storage device in the same region as the local computing node. The data set includes the data that participates in computation during task processing. However, the target off-site computing node usually does not store this data set, and the data that participates in computation during task processing needs to be migrated to the target off-site computing node.
[0051] For local computing nodes, the data required for task processing can be obtained directly from the dataset stored in the same region based on the metadata cached on the node and the tasks scheduled to the node, so as to process the tasks scheduled to the node.
[0052] For a target off-site computing node, after receiving a portion of the tasks scheduled to this node, it can determine L loading resources based on the amount of data required by the tasks scheduled to this node, the expected loading cost, and / or the expected loading time. It then utilizes these L loading resources to load the data required by the tasks scheduled to this node from the dataset in parallel, where L is an integer greater than 0. For example, each loading resource can load one-L of the data required by the tasks scheduled to this node. This embodiment dynamically determines the number of loading resources based on the amount of data to be loaded, the user's requirements for loading cost, and / or loading time, achieving dynamic scalability of the loading resources.
[0053] For example, please refer to Figure 3 If the target off-site computing node determines that it needs 5 loading resources, and if it already has fewer than 5 loading resources, such as 2 existing loading resources, it can apply for 3 more loading resources from the loading resource pool (including several loading resources). Thus, it can use 5 loading resources to load data from the data set in parallel, thereby improving data processing efficiency. After loading is completed, some loading resources can be released to achieve dynamic scalability of loading resources.
[0054] The number of loaded resources is positively correlated with the amount of data required by the task scheduled to the target off-site computing node. That is, the larger the amount of data, the more resources are determined to be loaded, and vice versa. The number of loaded resources can be dynamically scaled according to the amount of data required during task processing, which is conducive to quickly loading the data required during task processing to improve task processing efficiency.
[0055] In cloud service scenarios, requesting more loading resources for a target, geographically dispersed computing node may incur higher costs. Users also consider these loading costs. Users can set their expected loading cost based on their actual needs. The quantity of loading resources is positively correlated with the expected loading cost; that is, the higher the user's expected loading cost, the more loading resources can be requested to achieve parallel data loading and improve loading efficiency, and vice versa. This allows users to meet their personalized loading needs.
[0056] In some scenarios, users also have certain considerations regarding loading time. Users can set the expected loading time according to their actual needs. The number of loading resources is negatively correlated with the expected loading time. That is, the shorter the expected loading time, the more loading resources can be requested to achieve parallel data loading and improve loading efficiency, and vice versa, thereby meeting the user's personalized loading needs.
[0057] In one example, the appropriate number of loading resources can be determined by comprehensively considering the amount of data required by the task scheduled to the target remote computing node, the expected loading cost, and the expected loading time, so as to load the data required by the task scheduled to the target remote computing node from the data set and achieve a balance between cost and efficiency.
[0058] In one exemplary embodiment, please refer to Figure 4 , Figure 4 The diagram illustrates the execution timing of a scheduler, local computing nodes, and a target remote computing node in a distributed system. The local storage device is located in the same region as the scheduler and stores data sets corresponding to the various tasks, along with metadata and other information about these data sets. Each local computing node includes a memory and a processor. The target remote computing node also includes a memory and a processor.
[0059] (1) In response to the storage event of incremental data in the data set corresponding to the several tasks, the scheduling device updates the metadata of the data set stored in the local storage device.
[0060] (2) The scheduling device synchronizes and caches the updated metadata to the local computing node; (3) The scheduling device synchronizes the updated metadata to the target remote computing node. Steps (2) and (3) can be executed simultaneously or sequentially.
[0061] (4) The local compute node returns a response indicating that metadata synchronization is complete. The scheduled task can then begin execution on the local compute node.
[0062] (5) The target remote computing node returns a response indicating that metadata synchronization is complete. Then the scheduling task can begin to be scheduled for execution on the target remote node.
[0063] (6) The scheduling device schedules some of the tasks to the local computing node for processing.
[0064] (7) The processor of the local computing node can read the data that needs to be used in the calculation during the task processing from the memory of the local computing node based on the synchronized metadata.
[0065] (8) If the local computing node does not have cached data that needs to be used in the task processing in its memory, the local computing node reads the relevant data from the local storage device and caches it in the local computing node's memory.
[0066] (9) The local computing node’s memory returns the data that needs to be used in the calculation during the task processing to the processor.
[0067] (10) The processor of the local computing node processes the task based on the read data.
[0068] (11) The scheduling device schedules another small part of the tasks to the target off-site computing node for processing.
[0069] (12) The processor of the target remote computing node can read the data that needs to be used in the calculation during the task processing from the memory of the target remote computing node according to the synchronized metadata.
[0070] (13) If the target remote computing node does not cache the data that needs to be processed during the task, the target remote computing node determines L loading resources based on the amount of data required by the task scheduled to this node, the expected loading cost and / or the expected loading time, and uses the L loading resources to load the data required by the task scheduled to this target remote computing node from the data set in parallel and cache it in the memory of this target remote computing node.
[0071] (14) The memory of the target remote computing node returns the data that needs to be used in the calculation during the task processing to the processor of this target remote computing node.
[0072] (15) The processor of the target remote computing node processes the task based on the read data.
[0073] (16) The target remote computing node returns a response message to the scheduling device indicating that the data required for computation has been loaded.
[0074] (17) In response to the fact that the target off-site computing node has cached data, the scheduling task schedules another large part of the tasks to the target off-site computing node for processing.
[0075] (18) The processor of the target remote computing node can read the data that needs to be processed during the task processing from the memory of the target remote computing node according to the synchronized metadata.
[0076] (19) If the target remote computing node's memory cache contains data that needs to be used in the calculation during the task processing, it can directly return the data that needs to be used in the calculation during the task processing to the processor of this target remote computing node.
[0077] (20) The processor of the target remote computing node processes the task based on the read data.
[0078] In some embodiments, if the task is first scheduled to the target remote computing node, and the target remote computing node loads data from the dataset across regions as needed during task processing, the running resources (such as CPU) on the target remote computing node will be wasted waiting for data to be loaded across regions. For this issue, please refer to [link to relevant documentation]. Figure 5 This specification provides another task scheduling method for a distributed system, wherein the distributed system includes several computing nodes and multiple scheduling devices, the computing nodes are distributed across multiple regions, and the multiple scheduling devices correspond one-to-one with each of the multiple regions and are distributed in each region respectively; the method is applied to any one of the scheduling devices; the method includes:
[0079] In step S201, in response to a task scheduling request, several tasks to be scheduled and a data set corresponding to the several tasks are determined, wherein the data set includes data involved in the calculation during task processing.
[0080] In step S202, some of the tasks among the several tasks are scheduled to be processed on the local computing node according to the data set and the inventory of the local computing node's operating resources; wherein, the local computing node is a computing node located in the same region as the scheduling device.
[0081] In step S203, a target remote computing node for processing tasks is determined from the remote computing nodes; the target data in the data set that will participate in the computation when the target remote computing node processes the task is predicted at regular intervals; after caching the predicted target data to the target remote computing node, the number of tasks scheduled to be processed in the target remote computing node is determined based on the total amount of target data already cached in the target remote computing node and the current inventory of the operating resources of the target remote computing node, and a corresponding number of tasks from the plurality of tasks are scheduled to be processed in the target remote computing node; wherein, the remote computing node is a computing node located in a different region from the scheduling device.
[0082] In this embodiment, to avoid wasting resources in the target remote computing node due to waiting, the system periodically predicts the target data in the data set that will participate in the computation when the target remote computing node processes a task. After caching the predicted target data in the target remote computing node, another part of the task to be processed is scheduled to be processed in the target remote computing node based on the total amount of target data already cached in the target remote computing node. Thus, the target remote computing node can directly obtain the data to be processed from its own cache space during the task processing, reducing the waiting time for data loaded across regions and improving the processing efficiency of the task in the target remote computing node.
[0083] It is understood that steps S202 and S203 can be executed in parallel until all the tasks are completed. The scheduling device can schedule some of the tasks to the local computing node and another part of the tasks to the target remote computing node, so that the local computing node and the target remote computing node can process the tasks in parallel.
[0084] The timing of steps S202 and S203 is explained below: For example, if the task execution status on the local computing node is not required during the prediction of the target data, steps S202 and S203 can begin simultaneously and be executed in parallel. For example, if the task execution status on the local computing node is required during the prediction of the target data, step S202 will execute for a period of time before step S203 begins, and then the two steps will be executed in parallel.
[0085] For local compute nodes, the number of tasks scheduled to be processed by the local compute node each time is positively correlated with the current inventory of the local compute node's running resources.
[0086] For a target off-site computing node, the number of tasks scheduled to be processed each time needs to consider not only the current inventory of the target off-site computing node's runtime resources, but also the total amount of target data already cached on the target off-site computing node. For example, the number of tasks scheduled to be processed on the target off-site computing node is positively correlated with the current inventory of runtime resources on the target off-site computing node; that is, the more runtime resources the target off-site computing node has, the more tasks can be scheduled to be processed on the target off-site computing node, which is beneficial for improving task processing efficiency, and vice versa. For example, the number of tasks scheduled to be processed on the target off-site computing node is also positively correlated with the total amount of target data already cached on the target off-site computing node; that is, the greater the amount of target data already cached on the target off-site computing node, the more likely the target off-site computing node is to directly read the desired data from its cache space, thus the more tasks can be scheduled to be processed on the target off-site computing node, which is beneficial for improving task processing efficiency, and vice versa.
[0087] In this approach, the target data can be cached in the target off-site computing node before the remaining tasks are scheduled to be processed in the target off-site computing node. This allows the target off-site computing node to directly obtain the data used in the computation from its own cache space during task processing, reducing the waiting time for data loaded across regions and improving the processing efficiency of tasks in the target off-site computing node.
[0088] The following is an example illustration of the prediction process for target data:
[0089] In one possible implementation, during each prediction process, the scheduling device can predict the target data to be included in the computation based on the data access status of the local computing node during task processing. In this case, the initial prediction of the target data needs to be performed after a preset duration since the local computing node started processing the task. For example, the accessed data can be accessed data from at least one hour prior to the current prediction time. The preset duration can be specifically set according to the actual application scenario; this embodiment does not impose any restrictions on it. For example, the preset duration could be half an hour or one hour, etc. The accessed data could be accessed data from the past four hours prior to the current prediction time.
[0090] In one example, some or all of the data accessed by the local computing node during task processing can be identified as the target data. In another example, data that meets preset conditions in the data accessed by the local computing node during task processing can be identified as the target data. The preset conditions may be data whose access frequency is higher than an access threshold. Data that the local computing node frequently accesses is also very likely to be accessed by the target remote computing node. Therefore, caching this data in advance in the target remote computing node is beneficial to improving data access efficiency. The access threshold can be set specifically according to the actual application scenario. This embodiment does not impose any restrictions on this.
[0091] In one possible implementation, during each prediction process, the scheduling device can determine the target data based on incremental data within a historical time period in the dataset. The historical time period includes the past N hours starting from the current prediction time, where N is greater than 0. For example, the target data can be part or all of the incremental data. In this embodiment, considering that computing nodes are more likely to access newly added data in the dataset, the incremental data is pre-cached in the target off-site computing node, which helps improve data access efficiency.
[0092] In one possible implementation, during each prediction process, the scheduling device can comprehensively determine the target data based on the access data of the local computing node during task processing and the incremental data within historical time periods in the data sets corresponding to the several tasks, thereby improving prediction accuracy. In this case, the initial prediction of the target data needs to be performed after a preset time since the local computing node started processing the task, such as half an hour or one hour after the local computing node first started executing the task.
[0093] For example, the X most frequently accessed data items and the Y least frequently accessed data items can be determined from the access data, where X and Y are integers greater than 0. The X most frequently accessed data items are data frequently accessed by the local computing node and are also highly likely to be accessed by the target remote computing node. The Y least frequently accessed data items are data rarely accessed by the local computing node and are also highly likely to be data not accessed by the target remote computing node. The target data that is highly likely to be accessed by the target remote computing node can be determined by removing the Y least frequently accessed data items from the incremental data and combining them with the X most frequently accessed data items. That is, the target data includes: the X most frequently accessed data items from the access data, and part or all of the remaining data after removing specified data from the incremental data; the specified data are the Y least frequently accessed data items from the access data, where X and Y are integers greater than 0.
[0094] For example, the target data can be determined based on the difference between the incremental data and the access data. The difference between the incremental data and the access data is incremental data that the target off-site computing node has not accessed but is highly likely to access. For example, the target data includes part or all of the difference between the incremental data and the access data.
[0095] In some embodiments, after the target data is obtained through periodic prediction, the scheduling device can cache the target data in the target off-site computing node. If it is determined that the target data has been cached, the task is scheduled to be processed on the target off-site computing node. Considering that the target data predicted in subsequent prediction processes may contain identical parts to the target data predicted in previous prediction processes, to avoid resource waste caused by repeated caching, after the target data is obtained in subsequent predictions, data not cached by the target off-site computing node can be identified, and then this uncached data can be cached on the target off-site computing node.
[0096] In some embodiments, after each determination of the target data, the scheduling device may send a notification message to the target off-site computing node to load the target data, the notification message carrying data volume information of the target data. For example, after the target data is predicted a non-first time, if the data cached on the target off-site computing node is data that the target off-site computing node has not cached in the current predicted target data, then the data volume information carried in the notification message specifically refers to the data volume information of the data that the target off-site computing node needs to load.
[0097] The target off-site computing node is also configured to respond to the notification message, determine M loading resources based on the data volume information of the target data, and utilize the M loading resources to load the target data in parallel from the data set; where M is an integer greater than 0. For example, each loading resource loads 1 / M of the target data. The number of loading resources is positively correlated with the data volume of the target data; that is, the larger the data volume of the target data, the more loading resources are needed, thereby improving loading efficiency. In this embodiment, to achieve fast loading of target data, the loading resources are dynamically scalable based on the data volume of the target data. When the data volume of the target data is large, more loading resources can be requested to load the target data, improving loading efficiency.
[0098] For example, if the target off-site computing node determines that it needs M loading resources, and if it already has fewer than M loading resources, it can apply for more loading resources from the loading resource pool to reach M loading resources. The M loading resources can then be used to load one-Mth of the target data from the data set in parallel. After loading is complete, a portion of the loading resources can be released, thus achieving dynamic scalability of the loading resources.
[0099] In one possible implementation, in a cloud service scenario, requesting more loading resources from a geographically located computing node may incur higher costs. However, in some scenarios, users may want to load data as quickly as possible to improve task processing efficiency. Therefore, users can set their expected loading costs and / or loading times via a client application (e.g., expected loading costs, expected loading times, and whether to prioritize loading costs or loading times). The target geographically located computing node can then determine M loading resources based on the target data volume and the expected loading costs and / or loading times. These M resources are then used to load the target data from the dataset in parallel, thus meeting the user's personalized loading needs.
[0100] The number of loading resources is positively correlated with the loading cost indicated in the expected information. That is, the higher the user's expected loading cost, the more loading resources can be requested to achieve parallel data loading and improve loading efficiency, and vice versa, thus meeting the user's personalized loading needs. The number of loading resources is negatively correlated with the loading time indicated in the expected information. That is, the shorter the user's expected loading time, the more loading resources can be requested to achieve parallel data loading and improve loading efficiency, and vice versa, thus meeting the user's personalized loading needs.
[0101] In some embodiments, after caching the target data in the target off-site computing node, the scheduling device can determine the number of tasks to be scheduled for processing in the target off-site computing node based on the amount of target data already cached in the target off-site computing node and the current inventory of the running resources of the target off-site computing node, and schedule the corresponding number of tasks to be processed in the target off-site computing node. It should be noted that after the predicted target data is cached in the target off-site computing node for the first time, the scheduling device can continue to schedule tasks to be processed in the target off-site computing node in response to the current inventory of the running resources of the target off-site computing node being non-zero, until all tasks are scheduled.
[0102] In some embodiments, the target off-site computing node is further configured to return a task processing success rate after processing each task scheduled to this node; then, during the process of predicting target data for the first time, the scheduling device can also determine the amount of target data to be predicted this time based on the task processing success rate previously returned by the target off-site computing node. The task processing success rate previously returned by the target off-site computing node is positively correlated with the amount of target data to be predicted this time, that is, the higher the processing success rate returned last time, the better the operating performance of the target off-site computing node, and more tasks can be scheduled to the target off-site computing node. Accordingly, the amount of target data to be predicted this time is larger, and thus the amount of target data to be predicted this time is larger. After data is cached on the target off-site computing node, the more tasks are scheduled to run on that node, the better. Conversely, the lower the success rate of the previous processing, the worse the performance of the target off-site computing node, resulting in a smaller amount of target data to be predicted. Consequently, after caching the predicted target data on the target off-site computing node, fewer tasks are scheduled to run on that node. This embodiment dynamically adjusts the amount of target data cached on the target off-site computing node next time based on its actual execution status, thereby indirectly adjusting the number of tasks scheduled to the target off-site computing node next time. This achieves a virtuous cycle of scheduling and improves the task execution success rate.
[0103] Please see Figure 6 , Figure 6 The diagram illustrates the execution timing of a scheduler, local computing nodes, and a target remote computing node in a distributed system. The local storage device is located in the same region as the scheduler and stores data sets corresponding to the various tasks, along with metadata and other information about these data sets. Each local computing node includes a memory and a processor. The target remote computing node also includes a memory and a processor.
[0104] (1) In response to the storage event of incremental data in the data set corresponding to the several tasks, the scheduling device updates the metadata of the data set stored in the local storage device.
[0105] (2) The scheduling device synchronizes and caches the updated metadata to the local computing node; (3) The scheduling device synchronizes the updated metadata to the target remote computing node. Steps (2) and (3) can be executed simultaneously or sequentially.
[0106] (4) The local compute node returns a response indicating that metadata synchronization is complete. The scheduled task can then begin execution on the local compute node.
[0107] (5) The target remote computing node returns a response indicating that metadata synchronization is complete. Then the scheduling task can begin to be scheduled for execution on the target remote node.
[0108] (6) The scheduling device schedules some of the tasks to the local computing node for processing.
[0109] (7) The processor of the local computing node can read the data that needs to be used in the calculation during the task processing from the memory of the local computing node based on the synchronized metadata.
[0110] (8) If the local computing node does not have cached data that needs to be used in the task processing in its memory, the local computing node reads the relevant data from the local storage device and caches it in the local computing node's memory.
[0111] (9) The local computing node’s memory returns the data that needs to be used in the calculation during the task processing to the processor.
[0112] (10) The processor of the local computing node processes the task based on the read data.
[0113] (11) The scheduling device predicts the target data in the data set that will participate in the operation when the target off-site computing node processes the task.
[0114] (12) The scheduling device sends a notification message to the target remote computing node to load the target data, and the notification message carries the data volume information of the target data.
[0115] (13) The target off-site computing node determines M data based on the data volume information of the target data and the expected information on loading cost and / or loading time, and uses the M loading resources to load the target data from the data set in parallel and cache it in the memory of the target off-site computing node.
[0116] (14) The target remote computing node returns a response message to the scheduling device that the target data has been loaded.
[0117] (15) The scheduling device schedules another part of the tasks among the several tasks to the target remote computing node for processing based on the total amount of target data cached by the target remote computing node and the current inventory of the operating resources of the target remote computing node.
[0118] (16) The processor of the target remote computing node can read the data that needs to be used in the calculation during the task processing from the memory of the target remote computing node according to the synchronized metadata.
[0119] (17) If the target remote computing node's memory cache contains data that needs to be used in the calculation during the task processing, it can directly return the data that needs to be used in the calculation during the task processing to the processor of this target remote computing node.
[0120] (18) The processor of the target remote computing node processes the task based on the read data.
[0121] It is understandable that steps (6) to (20) can be repeated before several tasks have been scheduled to be completed.
[0122] In some embodiments, a task can be decomposed into multiple subtasks. For any given task, the scheduling device can generate a resource scheduling strategy corresponding to the task based on the amount of runtime resources required by the task, the current inventory of runtime resources in the local computing node, and the current inventory of runtime resources in the target remote computing node. The resource scheduling strategy instructs each subtask included in the task to be processed on the local computing node or the target remote computing node. Then, according to the resource scheduling strategy corresponding to the task, the multiple subtasks included in the task are scheduled to be processed on the corresponding computing nodes.
[0123] For example, please refer to Figure 7 A task can be broken down into, for example... Figure 7 The directed acyclic graph structure shown represents multiple subtasks; for example, a task can be decomposed into... Figure 7The 13 tasks shown can be scheduled by a scheduling device based on the amount of runtime resources required by each subtask, the current inventory of runtime resources in the local computing node, and the current inventory of runtime resources in the target remote computing node. This determines whether each subtask should be executed on the local computing node or the target remote computing node, thus generating a resource scheduling strategy for that task. In one example, the scheduling device can sequentially decide whether each subtask should be executed on the local computing node or the target remote computing node, starting with subtask 1. It can prioritize scheduling subtasks to the local computing node. After the local computing node runs out of runtime resources, the remaining subtasks are prioritized and scheduled to the nearest target remote computing node based on distance. Finally, after the nearest target remote computing node runs out of runtime resources, the unscheduled subtasks are scheduled to the farthest target remote computing node.
[0124] In some embodiments, in real-world scenarios, the runtime resources provided by the computing nodes (including local computing nodes and target remote computing nodes) have different pricing methods. The efficiency of the computing nodes in processing tasks using runtime resources priced according to different methods also varies. Users need to weigh the task execution cost and task execution efficiency according to their actual needs. That is, the runtime resources in any computing node include at least two types of runtime resources with different costs, and the computing node processes tasks with different efficiencies using each of the at least two runtime resources.
[0125] In one example, the runtime resources in a compute node include PayAsGo pay-as-you-go runtime resources and spot auction runtime resources. The cost of using PayAsGo pay-as-you-go runtime resources is higher than the cost of using spot auction runtime resources, but the queuing time during task processing is shorter and the processing efficiency is higher; while the cost of using spot auction runtime resources is lower than the cost of using PayAsGo pay-as-you-go runtime resources, but the queuing time during task processing may be longer and the processing efficiency is reduced.
[0126] Therefore, in order to meet the user's cost and / or efficiency requirements, for any one such as Figure 7 The scheduling strategy for the task shown can be generated based on the amount of runtime resources required by the task, the current inventory of at least two runtime resources in the local computing node, the current inventory of at least two runtime resources in the target remote computing node, and the expected information on task processing cost and / or task processing success rate. The resource scheduling strategy for the task is used to indicate whether any subtask in the task is processed in the local computing node or the target remote computing node, and the types of runtime resources used to process any subtask.
[0127] Resource scheduling strategies for at least two types of runtime resources with different costs can be preset according to the user's actual needs. For example, the expected information regarding task processing cost and / or task processing success rate includes the expected usage of the at least two runtime resources, the expected execution order, the maximum usage of the resource with the higher cost, the expected processing cost of any task, the expected processing efficiency of any task, and / or the expected usage of the at least two runtime resources, etc. The expected usage of the at least two runtime resources is negatively correlated with runtime; the lower the expected usage, the longer the queuing time, and the longer the runtime of the corresponding tasks; conversely, the higher the expected usage, the shorter the queuing time, and the shorter the runtime of the corresponding tasks can be.
[0128] In one example, if the user prefers cost savings over efficiency improvements, the resource scheduling strategy can be set to prioritize allocating low-cost runtime resources to subtasks on both local and target remote computing nodes. If low-cost runtime resources are unavailable, then high-cost runtime resources can be allocated to subtasks on both local and target remote computing nodes. And / or, the usage of high-cost runtime resources can be limited to a lower amount than that of low-cost runtime resources.
[0129] In another example, if the user prefers to improve efficiency over cost savings, the resource scheduling strategy can prioritize allocating high-cost running resources to subtasks on both the local computing node and the target remote computing node. If the high-cost running resources are unavailable, then low-cost running resources can be allocated to subtasks on both the local computing node and the target remote computing node; and / or, the usage of high-cost running resources can be limited to a higher amount than the usage of low-cost running resources.
[0130] In one example, the runtime resources in a compute node include PayAsGo pay-as-you-go runtime resources and spot auction runtime resources, for example... Figure 7 The task shown is subject to resource scheduling, and the generated resource scheduling policy is as follows:
[0131] (1) Subtasks 1 to 3 are executed on local computing node 1, using spot-bid type runtime resources;
[0132] (2) Subtasks 4 and 5 are executed on local computing node 1, using PayAsGo pay-as-you-go runtime resources;
[0133] (3) Subtasks 6 to 8 are executed on local computing node 2, using spot-bid type runtime resources;
[0134] (3) Subtasks 9 and 10 are executed on the target off-site computing node 1, and the runtime resources used are spot-bid type runtime resources;
[0135] (4) Subtasks 11 to 13 are executed on the target off-site computing node 1, using PayAsGo pay-as-you-go runtime resources.
[0136] In some exemplary embodiments, please refer to Figure 8 The scheduling device includes a task receiving unit, a task decomposition unit, a scheduling strategy generation unit, and a scheduling unit. The task receiving unit receives several tasks submitted by a user's client and sends these tasks to the task decomposition unit and the scheduling strategy generation unit. The task decomposition unit decomposes the tasks into several sub-tasks and feeds them back to the scheduling unit. The scheduling strategy generation unit generates a resource scheduling strategy corresponding to the task based on the amount of runtime resources required by the task, the current inventory of PayAsGo and spot-based runtime resources on the local computing node, the current inventory of PayAsGo and spot-based runtime resources on the target off-site computing node, and expected information on task processing cost and / or task processing success rate, and feeds it back to the scheduling unit. The scheduling unit schedules the multiple sub-tasks included in the task to corresponding computing nodes for processing according to the resource scheduling strategy corresponding to the task. For example, the scheduling unit can call the interface of the corresponding computing node to schedule the sub-tasks to the corresponding computing node.
[0137] In some embodiments, while the task device generates a resource scheduling policy corresponding to any task and schedules multiple subtasks within that task to corresponding computing nodes according to the resource scheduling policy, the computing nodes are also processing the subtasks already scheduled to their nodes. (See also...) Figure 8 After processing the subtask scheduled to its location, any computing node can return the subtask processing success rate to the scheduling device. Upon receiving this subtask processing success rate, the scheduling device, in generating the resource scheduling strategy for any subsequent task, can further refer to the subtask processing success rates previously returned by the local computing node and / or the target remote computing node, in addition to the aforementioned information. For example, in... Figure 8 In the embodiment shown, the scheduling unit can send the subtask processing success rate returned by the target remote computing node in one instance to the scheduling strategy generation unit for use.
[0138] For example, the scheduling device can generate a resource scheduling strategy for the task based on the amount of operating resources required by the task, the current inventory of operating resources in the local computing node, the current inventory of operating resources in the target remote computing node, and the success rate of subtask processing returned by the local computing node and / or the target remote computing node in the previous instance. The number of subtasks scheduled to any computing node is positively correlated with the success rate of subtask processing returned by that computing node in the previous instance. That is, the higher the success rate of subtask processing returned by the computing node in the previous instance, the better the operating performance of the computing node, and more subtasks can be scheduled to that computing node; conversely, the lower the success rate of subtask processing returned by the previous instance, the worse the operating performance of the computing node, and fewer subtasks can be scheduled to that computing node. This embodiment dynamically adjusts the number of subtasks scheduled to be processed by the computing node in the next instance based on the actual execution status of the computing node, achieving a virtuous cycle scheduling process and improving the task execution success rate.
[0139] For example, the scheduling device can generate a resource scheduling strategy for the task based on any one or more of the following: the amount of runtime resources required for the task, the current inventory of the at least two runtime resources in the local computing node, the current inventory of the at least two runtime resources in the target remote computing node, the expected information on task processing cost and / or task processing success rate, and the subtask processing success rate returned by the local computing node and / or the target remote computing node in the last time.
[0140] In some embodiments, to avoid resource waste in the target remote computing node due to waiting, the scheduling device periodically predicts the target data in the data set that will participate in the computation when the target remote computing node processes a task, and caches the target data in the target remote computing node. After caching the target data in the target remote computing node, in the resource scheduling strategy generation process for any subsequent task, in addition to referring to at least one of the above-mentioned information, the total amount of target data already cached in the target remote computing node can be further considered. That is, the resource scheduling strategy corresponding to any task can also be determined based on the total amount of target data already cached in the target remote computing node. The amount of data in subtasks scheduled to be processed on the target off-site computing node is positively correlated with the total amount of data. That is, the larger the total amount of target data cached on the target off-site computing node, the higher the probability that the target off-site computing node can read the required data from its own cache space during task processing, and thus cannot load data across regions. This results in higher data reading efficiency, allowing more subtasks to be scheduled to be processed on the target off-site computing node. Conversely, the smaller the total amount of target data cached on the target off-site computing node, the higher the probability that the target off-site computing node needs to load data across regions during task processing. This results in lower data reading efficiency, allowing for a reduction in the number of subtasks scheduled to be processed on the target off-site computing node. This achieves a virtuous cycle of scheduling and is beneficial for improving task execution efficiency.
[0141] For example, the resource scheduling strategy for any task is generated based on at least one of the following information: the amount of runtime resources required by the task, the current inventory of the at least two runtime resources in the local computing node, the current inventory of the at least two runtime resources in the target remote computing node, expected information on task processing cost and / or task processing success rate, the subtask processing success rate returned by the local computing node and / or the target remote computing node after the last processing of the subtask scheduled to this node, and the total amount of target data that has been cached in the target remote computing node and will participate in the computation.
[0142] The various technical features in the above embodiments can be combined arbitrarily, as long as there is no conflict or contradiction between the combinations of features. Therefore, the arbitrary combination of the various technical features in the above embodiments is also within the scope of this specification.
[0143] Accordingly, please refer to Figure 1 The embodiments of this specification also provide a distributed system, including a plurality of computing nodes and a plurality of scheduling devices, wherein the plurality of computing nodes are distributed in a plurality of regions, and the plurality of scheduling devices correspond one-to-one with the plurality of regions and are distributed in each region respectively;
[0144] Wherein, any one of the scheduling devices is used to execute the method described in any one of the above; and any one of the computing nodes is used to process the tasks scheduled to be performed on this node.
[0145] Accordingly, please refer to Figure 6 This specification also provides an electronic device that is communicatively connected to a plurality of computing nodes in a distributed system, the plurality of computing nodes being distributed across multiple geographical regions. The device includes:
[0146] Processor 100;
[0147] Memory 200 for storing instructions that can be processed by the processor;
[0148] The processor 100, by executing the processable instructions, is used to:
[0149] In response to a task scheduling request, determine several tasks to be scheduled;
[0150] Based on the inventory of operating resources of the local computing node and the inventory of operating resources of the remote computing node, some of the tasks are scheduled to be processed on the local computing node, and another part of the tasks are scheduled to be processed on the target remote computing node.
[0151] The local computing node is a computing node located in the same region as the scheduling device, the remote computing node is a computing node located in a different region from the scheduling device, and the target remote computing node is a determined remote computing node used to process the other part of the task.
[0152] In some embodiments, the processor 100 is further configured to: acquire a data set corresponding to the plurality of tasks, the data set including data involved in computation during task processing; determine a target remote computing node for processing tasks from remote computing nodes; periodically predict target data in the data set that will participate in computation when the target remote computing node processes the task; after caching the predicted target data to the target remote computing node, determine the number of tasks to be scheduled to be processed in the target remote computing node based on the total amount of target data already cached in the target remote computing node and the current inventory of the running resources of the target remote computing node, and schedule a corresponding number of tasks from the plurality of tasks to be processed in the target remote computing node.
[0153] In some embodiments, the number of tasks scheduled to be processed in the target off-site computing node each time is positively correlated with the current inventory of running resources in the target off-site computing node; and / or, the number of tasks scheduled to be processed in the target off-site computing node each time is positively correlated with the total amount of target data cached in the target off-site computing node.
[0154] In some embodiments, the target data is determined based on access data of the local computing node during task processing; wherein the process of first predicting the target data is performed after a preset duration has elapsed since the local computing node began processing the task; and / or, the target data is determined based on incremental data in the dataset over a historical time period, the historical time period including the past N hours starting from the current prediction time, where N is greater than 0.
[0155] In some embodiments, the target data is predicted based on the access data and the incremental data; the target data includes: the X data with the highest access frequency in the access data, and part or all of the remaining data after removing specified data from the incremental data; the specified data is the Y data with the lowest access frequency in the access data, where X and Y are integers greater than 0; and / or, the target data includes: part or all of the difference set between the incremental data and the access data.
[0156] In some embodiments, the processor 100 is further configured to: receive a task processing success rate returned by the target remote computing node, the task processing success rate being returned by the target remote computing node after each task scheduled to this node has been processed.
[0157] In the process of predicting target data for the first time, the amount of target data predicted is determined based on the task processing success rate returned by the target off-site computing node in the previous time, and the amount of data is positively correlated with the task processing success rate; and / or, after the target data is predicted for the first time, the data cached to the target off-site computing node is the data that the target off-site computing node has not cached in the target data predicted this time.
[0158] In some embodiments, the processor 100 is further configured to: send a notification message for loading the target data to the target remote computing node, the notification message carrying data volume information of the target data, wherein the notification message is used to instruct the target remote computing node to determine M loading resources based on the data volume information of the target data, and to use the M loading resources to load the target data in parallel from the data set; wherein M is an integer greater than 0, and the number of loading resources is positively correlated with the data volume of the target data.
[0159] In some embodiments, the M loading resources are determined based on the data volume information of the target data and the expected loading cost and / or loading time; wherein the number of loading resources is positively correlated with the loading cost indicated by the expected information and negatively correlated with the loading time indicated by the expected information.
[0160] In some embodiments, the processor 100 is further configured to: update the metadata of the data set in response to the storage event of incremental data in the data set corresponding to the plurality of tasks, and synchronously cache the updated metadata to the local computing node and the target remote computing node, so that the local computing node and the target remote computing node read the data participating in the operation according to the metadata during the task processing.
[0161] In some embodiments, a task includes multiple subtasks; the processor 100 is further configured to: for any given task, generate a resource scheduling policy corresponding to the task based on the amount of running resources required by the task, the current inventory of running resources in the local computing node, and the current inventory of running resources in the target remote computing node; the resource scheduling policy is used to instruct any subtask included in the task to be processed in the local computing node or the target remote computing node; and schedule the multiple subtasks included in the task to be processed in the corresponding computing nodes according to the resource scheduling policy corresponding to the task.
[0162] In some embodiments, the runtime resources in any computing node include at least two types of runtime resources with different costs, and the computing nodes have different success rates in processing subtasks using the at least two types of runtime resources respectively.
[0163] The resource scheduling strategy for any task is generated based on at least one of the following information: the amount of runtime resources required by the task, the current inventory of the at least two runtime resources in the local computing node, the current inventory of the at least two runtime resources in the target remote computing node, expected information on task processing cost and / or task processing success rate, the subtask processing success rate returned by the local computing node and / or the target remote computing node after the last processing of the subtask scheduled to this node, and the total amount of target data cached in the target remote computing node that will participate in the computation; wherein, the resource scheduling strategy is used to indicate the type of runtime resources used to process any subtask included in the task in the local computing node or the target remote computing node.
[0164] The number of subtasks scheduled to be processed on any computing node is positively correlated with the success rate of the subtasks returned by that computing node in the last time; the data of subtasks scheduled to be processed on remote computing nodes is positively correlated with the total amount of data.
[0165] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions that can be executed by a processor of the device to perform the described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0166] A non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a terminal's processor, enables the terminal to perform the methods described above.
[0167] In an exemplary embodiment, this application also provides a computer program product, including a computer program that, when executed by a processor, is used to implement the task scheduling method described above.
[0168] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0169] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0170] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0171] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0172] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0173] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0174] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” used in one or more embodiments of this specification and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0175] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of one or more embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "in response to a determination," or "when," or "in the event of a determination."
[0176] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.
Claims
1. A task scheduling method for a distributed system, the distributed system comprising a plurality of computing nodes and a plurality of scheduling devices, the plurality of computing nodes being distributed in a plurality of regions, and the plurality of scheduling devices corresponding one-to-one with the plurality of regions and being distributed in each region respectively; The method is applied to any scheduling device; the method includes: In response to a task scheduling request, determine several tasks to be scheduled; Based on the inventory of operating resources of the local computing node and the inventory of operating resources of the remote computing node, some of the tasks are scheduled to be processed on the local computing node, and another part of the tasks are scheduled to be processed on the target remote computing node. Wherein, the local computing node is a computing node located in the same region as the scheduling device, the remote computing node is a computing node located in a different region from the scheduling device, and the target remote computing node is a determined remote computing node used to process the other part of the task. The step of scheduling another portion of the several tasks to the target off-site computing node for processing includes: Obtain the data set corresponding to the plurality of tasks, the data set including the data involved in the computation during the task processing; and determine the target off-site computing node for processing the task from the off-site computing nodes; Predict at regular intervals the target data in the data set that will participate in the computation when the target remote computing node processes the task. After caching the predicted target data to the target off-site computing node, the number of tasks to be scheduled to be processed in the target off-site computing node is determined based on the total amount of target data already cached in the target off-site computing node and the current inventory of the running resources of the target off-site computing node, and a corresponding number of tasks from the plurality of tasks are scheduled to be processed in the target off-site computing node.
2. According to the method of claim 1, the number of tasks scheduled to be processed in the target off-site computing node each time is positively correlated with the current inventory of running resources in the target off-site computing node.
3. According to the method of claim 1, the number of tasks scheduled to be processed in the target off-site computing node each time is positively correlated with the total amount of target data cached in the target off-site computing node.
4. The method according to claim 1, wherein the target data is determined based on the access data of the local computing node during task processing; wherein, The initial prediction of the target data is performed after a preset time has elapsed since the local computing node began processing the task; And / or, The target data is determined based on incremental data within a historical time period in the dataset, where the historical time period includes the past N hours starting from the current prediction time, and N is greater than 0.
5. The method according to claim 4, wherein the target data is predicted based on the access data and the incremental data; The target data includes: The access data consists of the X most frequently accessed data items and part or all of the remaining data after removing the specified data items from the incremental data; the specified data items are the Y least frequently accessed data items in the access data, where X and Y are integers greater than 0. And / or, The target data includes part or all of the difference between the incremental data and the accessed data.
6. The method according to any one of claims 1 to 5, further comprising: Receive the task processing success rate returned by the target remote computing node, wherein the task processing success rate is returned by the target remote computing node after each task scheduled to this node is processed; In the process of predicting target data for the first time, the amount of target data predicted is determined based on the task processing success rate returned by the target off-site computing node in the previous time, and the amount of data is positively correlated with the task processing success rate. And / or, After the target data is predicted for the first time, the data cached on the target off-site computing node is the data that the target off-site computing node has not cached in the target data predicted this time.
7. The method according to any one of claims 1 to 4, further comprising, after the target data to be processed when the target remote computing node processes the task in the predicted data set: A notification message for loading the target data is sent to the target off-site computing node. The notification message carries the data volume information of the target data. The notification message is used to instruct the target off-site computing node to determine M loading resources based on the data volume information of the target data, and to use the M loading resources to load the target data in parallel from the data set. Here, M is an integer greater than 0, and the number of loading resources is positively correlated with the data volume of the target data.
8. The method according to claim 7, wherein the M loading resources are determined based on the data volume information of the target data and the expected loading cost and / or loading time; wherein, The number of resources loaded is positively correlated with the loading cost indicated by the expected information and negatively correlated with the loading time indicated by the expected information.
9. The method according to any one of claims 1 to 5, further comprising: In response to the storage event of incremental data in the data set corresponding to the plurality of tasks, the metadata of the data set is updated, and the updated metadata is synchronously cached in the local computing node and the target remote computing node, so that the local computing node and the target remote computing node can read the data participating in the operation according to the metadata during the task processing.
10. The method according to claim 1, wherein a task comprises multiple subtasks; The step of scheduling a portion of the tasks to the local computing node for processing and scheduling another portion of the tasks to a target remote computing node for processing includes: For any given task, a resource scheduling strategy is generated based on the amount of runtime resources required by the task, the current inventory of runtime resources in the local computing node, and the current inventory of runtime resources in the target remote computing node. The resource scheduling strategy is used to instruct any subtask included in the task to be processed on the local computing node or the target remote computing node. Based on the resource scheduling strategy corresponding to the task, the multiple subtasks included in the task are scheduled to be processed in the corresponding computing nodes.
11. The method according to claim 10, wherein the running resources in any computing node include at least two types of running resources with different costs, and the success rates of the computing nodes in processing subtasks using the at least two types of running resources are different; The resource scheduling strategy for any task is generated based on at least one of the following pieces of information: The resource quantity required for the task, the current inventory of the at least two types of running resources in the local computing node, the current inventory of the at least two types of running resources in the target remote computing node, the expected information on task processing cost and / or task processing success rate, the subtask processing success rate returned by the local computing node and / or the target remote computing node after the last processing of the subtask scheduled to this node, and the total amount of target data that has been cached in the target remote computing node and will participate in the computation. in, The number of subtasks scheduled to be processed on any computing node is positively correlated with the success rate of the subtasks returned by that computing node in the last time. The data of subtasks scheduled for processing in remote computing nodes is positively correlated with the total amount of data.
12. A distributed system, comprising a plurality of computing nodes and a plurality of scheduling devices, wherein the plurality of computing nodes are distributed in a plurality of regions, and the plurality of scheduling devices correspond one-to-one with the plurality of regions and are distributed in each region respectively; Any scheduling device is used to execute the method according to any one of claims 1 to 11; Each of the computing nodes is used to process the tasks scheduled for this node.
13. An electronic device, comprising: processor; Memory used to store instructions that can be processed by the processor; The processor implements the method as described in any one of claims 1 to 11 by executing the processable instructions.
14. A computer-readable storage medium having stored thereon computer instructions that, when processed by a processor, implement the steps of the method as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Task distribution method and device, electronic device and storage medium
CN110109752A