Distributed task processing method and device and related product

By determining the performance index matching on the distributed computing node and selecting the appropriate task distribution method, the problem of imbalanced load in distributed training has been solved, and the utilization rate and training efficiency of computing resources are improved.

CN119336468APending Publication Date: 2025-01-21CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1

Patent Information

Application Number
CN202411456082.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing distributed training methods have shortcomings in load balancing, resulting in waste of computing resources and reduced overall training efficiency.

Method used

By obtaining the availability of the performance index of the calculation node and the value of the performance index of existing tasks, the performance index matching of each calculation node is determined, and the appropriate allocation method is selected in multiple task allocation methods according to the matching method to achieve the task to achieve the task Reasonable allocation and load balancing.

Benefits of technology

It improves the utilization of computing resources, reduces resource waste, and improves the overall efficiency of distributed training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336468A_ABST
    Figure CN119336468A_ABST
Patent Text Reader

Abstract

The invention provides a distributed task processing method and device and a related product, and relates to the technical field of computers and the Internet. Performing distributed processing on a target task through a plurality of computing nodes, wherein the distributed processing method of the task comprises the following steps: obtaining a first sub-task of the target task; obtaining a performance index available value of each computing node and a performance index demand value of an existing task on each computing node; determining the performance index matching degree of each computing node according to the performance index available value of each computing node and the performance index demand value of the existing task on each computing node; determining a target task allocation method in the plurality of task allocation methods according to the performance index matching degree of each computing node; and performing task allocation on the first sub-task in the plurality of computing nodes according to the target task allocation method. According to the embodiment of the invention, load balancing can be realized among a plurality of computing nodes during distributed processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer and Internet technology, and in particular to a distributed processing method, device, electronic device, computer-readable storage medium, and computer program product for tasks. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] Existing distributed training methods have obvious deficiencies in load balancing. Due to unreasonable task allocation, some computing nodes may be overloaded, while other nodes may be idle, resulting in a waste of computing resources and a reduction in overall training efficiency.

[0004] How to achieve load balancing, reasonably allocate tasks or improve the utilization of computing resources in distributed training has become an urgent problem to be solved. Summary of the invention

[0005] The purpose of the present disclosure is to provide a distributed processing method, device, electronic device, computer-readable storage medium and computer program product for tasks, which can reasonably distribute tasks among multiple computing nodes and achieve load balancing, thereby improving the utilization of computing resources.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] The disclosed embodiment provides a distributed processing method for tasks, including: obtaining a first subtask of the target task; obtaining available values ​​of performance indicators of each computing node and required values ​​of performance indicators of existing tasks on each computing node; determining the performance indicator matching degree of each computing node according to the available values ​​of performance indicators of each computing node and required values ​​of performance indicators of existing tasks on each computing node; determining a target task allocation method from a plurality of task allocation methods according to the performance indicator matching degree of each computing node; and allocating the first subtask among the plurality of computing nodes according to the target task allocation method.

[0008] In some embodiments, the multiple computing nodes include a target computing node, wherein the performance indicator includes at least one of CPU, memory, network bandwidth, and I / O performance value; wherein, determining the performance indicator matching degree of each computing node according to the performance indicator available value of each computing node and the performance indicator requirement value of the existing tasks on each computing node includes: subtracting the CPU available value of the target computing node from the CPU requirement value of the existing tasks in the target computing node to obtain the CPU matching degree of the target computing node; subtracting the memory available value of the target computing node from the memory requirement value of the existing tasks in the target computing node to obtain the memory matching degree of the target computing node; subtracting the bandwidth available value of the target computing node from the bandwidth requirement value of the existing tasks in the target computing node to obtain the bandwidth matching degree of the target computing node; subtracting the I / O available value of the target computing node from the I / O requirement value of the existing tasks in the target computing node to obtain the I / O matching degree of the target computing node; performing weighted sum processing on at least one of the CPU matching degree, the memory matching degree, the bandwidth matching degree, and the I / O matching degree to obtain the performance indicator matching degree of the target computing node.

[0009] In some embodiments, a target task allocation method is determined among multiple task allocation methods based on the performance indicator matching degree of each computing node, including: adding the performance indicator matching degree of each computing node to obtain a total value of remaining performance indicators; if the total value of remaining performance indicators is greater than a first threshold, determining a first task allocation method as the target task allocation method among the multiple task allocation methods, wherein the first task allocation method is used to make the target task continuous and uninterrupted; if the total value of remaining performance indicators is less than or equal to the first threshold and greater than a second threshold, determining a second task allocation method as the target task allocation method among the multiple task allocation methods, wherein the second task allocation method is used to balance the node load when the node performance difference is large; wherein the first threshold is greater than the second threshold; if the total value of remaining performance indicators is less than or equal to the second threshold, determining a third task allocation method as the target task allocation method among the multiple task allocation methods, wherein the third task allocation method is used to balance the node load when the node performance is balanced.

[0010] In some embodiments, the target task allocation method is a first task allocation method; wherein, according to the target task allocation method, the first subtask is assigned among the multiple computing nodes, including: obtaining the target attribute value of the first subtask; performing hash calculation on the target attribute value of the first subtask to obtain a target hash value; performing modulo processing on the node number values ​​of the multiple computing nodes through the target hash value to obtain a first remainder; sequentially determining the first computing node among the multiple computing nodes according to the first remainder; and assigning the first subtask to the first computing node for processing.

[0011] In some embodiments, the target task allocation method is a second task allocation method; wherein, according to the target task allocation method, the first subtask is assigned to the multiple computing nodes, including: obtaining the node weight of each computing node, wherein the node weight is determined according to the performance indicator matching degree of each computing node; generating a weighted node list according to the node weight of each computing node, wherein the weighted node list includes multiple virtual nodes, wherein one computing node corresponds to one or more virtual nodes, wherein the proportion of the virtual nodes of the computing node in the weighted node list is equal to the node weight of the computing node; obtaining the task identifier of the first subtask; performing modulo processing on the number of virtual nodes in the weighted node list through the task identifier of the first subtask to obtain a second remainder; determining a first virtual node in the weighted node list according to the second remainder, wherein the first virtual node corresponds to a second computing node; and assigning the first subtask to the second computing node for processing.

[0012] In some embodiments, the method also includes: determining the load value of each computing node based on the performance indicator requirement value of the existing tasks on each computing node; obtaining a first load threshold and a second load threshold, wherein the first load threshold is greater than the average load value of the multiple computing nodes, and the second load threshold is less than the average load value; if there is a third computing node among the multiple computing nodes whose load value is greater than the first load threshold, then adding a new node to the multiple computing nodes and assigning the first subtask to the multiple computing nodes after the newly added node; if there is a fourth computing node among the multiple computing nodes whose load value is less than the second load threshold, then deleting the fourth computing node from the multiple computing nodes and reallocating the computing tasks on the fourth computing node.

[0013] In some embodiments, the target task includes multiple subtasks, and the multiple subtasks include a second subtask; wherein, before obtaining the first subtask of the target task, the method also includes: obtaining the task identifier of the second subtask; performing modulo processing on the node number values ​​of the multiple computing nodes through the task identifier of the second subtask to obtain a third remainder; sequentially determining the fifth computing node corresponding to the second subtask among the multiple computing nodes according to the third remainder; and assigning the second subtask to the fifth computing node for processing.

[0014] The embodiment of the present disclosure provides a distributed processing device for tasks, including: a subtask acquisition module, a performance indicator acquisition module, a performance indicator matching degree determination module, a target task allocation method determination module and a task allocation module.

[0015] Among them, the subtask acquisition module is used to acquire the first subtask of the target task; the performance indicator acquisition module can be used to acquire the available performance indicator values ​​of each computing node and the performance indicator requirement values ​​of the existing tasks on each computing node; the performance indicator matching degree determination module can be used to determine the performance indicator matching degree of each computing node based on the available performance indicator values ​​of each computing node and the performance indicator requirement values ​​of the existing tasks on each computing node; the target task allocation method determination module can be used to determine the target task allocation method among multiple task allocation methods based on the performance indicator matching degree of each computing node; the task allocation module can be used to allocate the first subtask among the multiple computing nodes according to the target task allocation method.

[0016] An embodiment of the present disclosure proposes an electronic device, which includes: a memory and a processor; the memory is used to store computer program instructions; the processor calls the computer program instructions stored in the memory to implement a distributed processing method for any of the tasks described above.

[0017] The embodiment of the present disclosure provides a computer-readable storage medium having computer program instructions stored thereon to implement a distributed processing method for tasks as described in any one of the above items.

[0018] The embodiment of the present disclosure provides a computer program product or a computer program, which includes computer program instructions stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the distributed processing method of the above-mentioned task.

[0019] The distributed processing method, device, electronic device, computer-readable storage medium and computer program product of the tasks provided by the embodiments of the present disclosure can determine the performance indicator matching degree of the computing node according to the available value of the performance indicator on the computing node and the performance indicator requirement value of the existing task, and then determine the task allocation method that meets the current computing node performance distribution situation in multiple task allocation methods according to the performance indicator matching degree of each computing node, so as to allocate the subtasks of the target task to each computing node for computing and processing. Through the above method, tasks can be reasonably allocated among multiple computing nodes to achieve load balancing, thereby improving the utilization rate of computing resources.

[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0022] Figure 1 A schematic diagram of a scenario showing a distributed processing method of a task or a distributed processing device of a task that can be applied to an embodiment of the present disclosure is shown.

[0023] Figure 2 The invention is a flowchart showing a distributed processing method of a task according to an exemplary embodiment.

[0024] Figure 3 The present invention is a flowchart of a method for determining a performance indicator matching degree according to an exemplary embodiment.

[0025] Figure 4 The invention is a flowchart showing a distributed processing method of a task according to an exemplary embodiment.

[0026] Figure 5 is a flowchart of a first task allocation method according to an exemplary embodiment.

[0027] Figure 6 is a flowchart of a second task allocation method according to an exemplary embodiment.

[0028] Figure 7 The present invention is a flowchart of a computing node adjustment method according to an exemplary embodiment.

[0029] Figure 8The figure is a flowchart of a task allocation method according to an exemplary embodiment.

[0030] Fig. 9 The figure is a flowchart of a task allocation method according to an exemplary embodiment.

[0031] Fig.10 The invention is a block diagram of a distributed processing device for a task according to an exemplary embodiment.

[0032] Fig.11 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0034] Those skilled in the art will appreciate that the embodiments of the present disclosure may be a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0035] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0036] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0037] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0038] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0039] In the description of the present disclosure, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a kind of association relationship describing the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different; the terms "comprising", "including" and "having" are used to express the meaning of open inclusion and mean that in addition to the listed elements / components / etc., there may be other elements / components / etc.

[0040] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0041] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.

[0042] With the rapid development of artificial intelligence and machine learning technologies, training large-scale deep learning models requires a lot of computing resources and time. Traditional single-machine training methods can no longer meet the needs of large-scale model training, so distributed training has become the main means to solve large-scale model training. Distributed large-model training improves training efficiency and speed by distributing computing tasks to multiple computing nodes.

[0043] This application will take the distributed training task as the training task of a large-scale deep learning model as an example for illustration, but this application is not limited to this, and other tasks that require distributed training can also be the target tasks in this application.

[0044] Existing distributed training methods (such as distributed large model training methods) mainly have the following technical problems.

[0045] 1. Unbalanced load: Existing distributed training methods cannot effectively balance the load among computing nodes, resulting in resource waste and low training efficiency.

[0046] 2. Lack of dynamic adjustment mechanism: Many existing methods lack flexible dynamic adjustment mechanisms in task allocation and node expansion, and cannot respond to load changes and resource requirements in a timely manner.

[0047] 3. High communication overhead: Frequent data exchange and parameter updates between nodes increase communication overhead and affect the overall training efficiency.

[0048] The present application can at least solve the above-mentioned problems through the following technical solutions.

[0049] 1. Dynamic load balancing algorithm: It uses a variety of load balancing algorithms, combined with real-time load monitoring data, to dynamically adjust task allocation to ensure full utilization of computing resources and balanced distribution of load.

[0050] 2. Flexible dynamic adjustment mechanism: Based on real-time monitoring data from Prometheus (an open source system monitoring and alarm toolkit) and Grafana (an open source interactive data visualization platform), set load thresholds, dynamically adjust task allocation strategies and the number of nodes, and respond to load changes and resource requirements in a timely manner to improve the adaptability and stability of the system.

[0051] 3. Optimize communication strategy: By dynamically allocating data batches and adjusting communication frequency, we can reduce synchronization overhead, optimize communication efficiency, and further improve the overall performance of distributed training.

[0052] In some embodiments, the technical solution improved by the present application can be used in at least the following scenarios.

[0053] 1. Large-scale enterprise-level artificial intelligence (AI) model training: In enterprises that need to train complex and large-scale deep learning models, such as finance, medical care, autonomous driving and other fields, the method improved in this application can greatly improve training efficiency and shorten the model development cycle.

[0054] 2. Cloud computing platform: Cloud computing service providers can use the technology of this application to provide users with more efficient distributed training services, optimize resource utilization, reduce operating costs, and improve customer experience.

[0055] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0056] Figure 1 A schematic diagram of a scenario showing a distributed processing method of a task or a distributed processing device of a task that can be applied to an embodiment of the present disclosure is shown.

[0057] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present disclosure.

[0058] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0059] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart homes, etc.

[0060] The server 105 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received request data, and feed back the processing results to the terminal device.

[0061] The server can be an independent physical server or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as basic cloud computing services such as big data and artificial intelligence platforms, etc. The present disclosure does not impose any restrictions on this.

[0062] Server 105 (which may be a node in a distributed system) may, for example, obtain the first subtask of the target task; server 105 may, for example, obtain the available values ​​of performance indicators of each computing node and the required values ​​of performance indicators of existing tasks on each computing node; server 105 may, for example, determine the performance indicator matching degree of each computing node based on the available values ​​of performance indicators of each computing node and the required values ​​of performance indicators of existing tasks on each computing node; server 105 may, for example, determine the target task allocation method among multiple task allocation methods based on the performance indicator matching degree of each computing node; server 105 may, for example, allocate the first subtask among multiple computing nodes based on the target task allocation method.

[0063] It should be understood that Figure 1 The number of terminal devices, networks and servers in the figure is only for illustration. The server 105 may be a physical server or may be composed of multiple servers. According to actual needs, it may have any number of terminal devices, networks and servers.

[0064] Figure 2 The invention is a flowchart showing a distributed processing method of a task according to an exemplary embodiment.

[0065] In some embodiments, the target task can be processed in a distributed manner by multiple computing nodes in a distributed system. The computing node can be an electronic device, a server, etc., and this application does not limit this.

[0066] In some embodiments, the present application embodiment can be completed by a node in a distributed system, such as by Figure 1 The process may be completed by a server or an electronic device or jointly by an electronic device and a server, and this application does not impose any restrictions on this.

[0067] Reference Figure 2 The distributed processing method of tasks provided by the embodiment of the present disclosure may include the following steps.

[0068] Step S202, obtaining the first subtask of the target task.

[0069] In some embodiments, the target task may be split into multiple subtasks for distributed processing. The multiple subtasks may be continuously generated during the execution of the target task or may be generated in advance, and this application does not impose any restrictions on this.

[0070] In some embodiments, the first subtask may be a task in the target task that needs to be assigned to a computing node for calculation. The first subtask may be a subtask that has never been assigned, or a subtask uninstalled from other computing nodes. This application does not impose any restrictions on this.

[0071] Step S204, obtaining the available value of the performance indicator of each computing node and the required value of the performance indicator of the existing tasks on each computing node.

[0072] In some embodiments, the above performance indicators may include CPU, memory, network bandwidth or I / O, etc.

[0073] The available value of the performance indicator may refer to the available value of the CPU, memory, network bandwidth or I / O that can be supported by the hardware on the computing node.

[0074] The performance indicator requirement value may refer to the amount of resources such as CPU, memory, network bandwidth or I / O required by the task that has been assigned to the computing node during the execution of the task on the computing node.

[0075] In some embodiments, the load information of each computing node may also be collected in real time: such as CPU usage, memory usage, network bandwidth, etc.

[0076] In some embodiments, a monitoring tool or an API may be used to obtain load information of a computing node.

[0077] Tool selection: 1. Prometheus: used for real-time collection and storage of time series data. Prometheus can flexibly obtain various load information of nodes through its rich API interface; 2. Grafana: used for data visualization and alarm. Grafana can extract data from Prometheus and display the load of nodes through various charts, and also supports setting alarm rules; 3. Data storage: load information is collected regularly and stored in a database (such as InfluxDB) or memory for quick access.

[0078] In some embodiments, the load Load_j of the computing node may be determined by the following formula: Load_j=w_1*CPU_j+w_2*MEM_j+w_3*NET_j.

[0079] Among them, CPU_j, MEM_j and NET_j are the CPU usage, memory usage and network bandwidth of the jth node respectively. Among them, w_1, w_2 and w_3 are the weight coefficients of each resource, which can be set through experiments or actual needs.

[0080] Step S206, determining the performance indicator matching degree of each computing node according to the available value of the performance indicator of each computing node and the required value of the performance indicator of the existing task on each computing node.

[0081] In some embodiments, the performance indicator available value of the computing node can be subtracted from the performance indicator requirement value of the existing tasks on the computing node to determine the utilization rate of each performance indicator on the computing node, and the utilization rate of each performance indicator can be used as the performance indicator matching degree of each computing node.

[0082] In some embodiments, the remaining demand for each performance indicator on the computing node may be determined by subtracting the performance indicator available value of the computing node from the performance indicator demand value of the existing tasks on the computing node.

[0083] For example, the performance index matching degree of a single computing node can be determined by the following formula:

[0084] Performance_Score(T,N)=

[0085] w_1*|CPU_T-CPU_N|+w_2*|MEM_T-MEM_N|+w_3*|NET_T-MET_N|.

[0086] Where T represents the task on the computing node, N represents the computing node, CPU_T, MEM_T, and NET_T represent the CPU, memory, and network requirements of the task on the computing node, CPU_N, MEM_N, and NET_N represent the CPU, memory, and bandwidth availability of the computing node, and w1, w2, and w3 represent the weights of each indicator, which can be adjusted according to the scenario.

[0087] In some embodiments, the performance indicator matching degree on a computing node may be used to measure the remaining performance indicators or available performance indicators or performance indicator requirements on the computing node.

[0088] Step S208, determining a target task allocation method from a plurality of task allocation methods according to the performance indicator matching degree of each computing node.

[0089] In some embodiments, before task scheduling, the distributed system may calculate the performance indicator matching degree based on the performance indicators of the nodes and tasks, and select the most appropriate load balancing algorithm (eg, selecting an appropriate task allocation method) based on the performance indicator matching degree.

[0090] In some embodiments, the performance indicator matching degrees of each computing node may be added together to obtain a total performance indicator matching degree.

[0091] In some embodiments, the performance indicator matching degree of each computing node may be averaged to obtain an average performance indicator matching degree.

[0092] In some embodiments, if the total performance indicator matching degree (or the average performance indicator matching degree) is too high, it can be considered that there are a lot of overloaded computing nodes; if the total performance indicator matching degree (or the average performance indicator matching degree) is generally high, it can be considered that there are overloaded computing nodes, but the number of overloaded computing nodes is not large; if the total performance indicator matching degree (or the average performance indicator matching degree) is relatively low, it is considered that there are fewer overloaded computing nodes and the computing tasks are more balanced.

[0093] In some embodiments, if the number of nodes whose performance indicator matching degree is greater than a certain threshold (such as a first threshold) among multiple computing nodes exceeds a certain value, it can be considered that there are a lot of overloaded computing nodes; if the number of nodes whose performance indicator matching degree is greater than a certain threshold among multiple computing nodes is within a certain range (such as less than or equal to the first threshold and greater than a second threshold), it can be considered that the overloaded computing nodes among the multiple computing nodes are within an acceptable range; if the number of nodes whose performance indicator matching degree is greater than a certain threshold among multiple computing nodes is less than a certain threshold (such as less than the second threshold), it is considered that there are fewer overloaded computing nodes and the computing tasks are more balanced.

[0094] In some embodiments, tasks on overloaded computing nodes may be redistributed.

[0095] In some embodiments, the load conditions on multiple computing nodes can be determined based on the matching degree of performance indicators of each computing node, so as to determine a target task allocation method that meets the current computing node load conditions from among multiple task allocation methods based on the load conditions of the multiple computing nodes.

[0096] In some embodiments, the plurality of task allocation methods may include a first task allocation method, a second task allocation method, and a third task allocation method.

[0097] Among them, the third task allocation method can be applicable to application scenarios with node load balancing; the second task allocation method can be adapted to scenarios with large differences in node loads; the first task allocation method can be adapted to scenarios where computing nodes require high availability (where high availability can mean that computing nodes must be available as much as possible or that damage to computing nodes does not affect the calculation of target tasks).

[0098] For example, if the performance indicator matching degree of multiple computing nodes is too large (such as greater than a first threshold) or the number of computing nodes whose performance indicator matching degree is greater than a certain threshold (such as the first threshold) exceeds a certain value, it can be determined that the computing performance of multiple computing nodes cannot meet the task requirements, and the computing tasks in the overloaded computing nodes need to be reallocated. The third task allocation method needs to be used to allocate tasks to the first subtask and the tasks in the overloaded computing nodes so that the load in multiple computing nodes is balanced and the calculation of the target task is not interrupted.

[0099] For another example, if the performance indicator matching degree of multiple computing nodes is higher than a certain threshold but not too large (such as less than or equal to the first threshold and greater than the second threshold) or the number of nodes in multiple computing nodes whose performance indicator matching degree is greater than a certain threshold is within a certain range (such as less than or equal to the first threshold and greater than the second threshold), then the second task allocation method can be used to allocate tasks to the first subtask and the tasks in the overloaded computing node so that the load of multiple computing nodes is balanced.

[0100] For another example, if the performance indicator matching degree of multiple computing nodes is very small (such as less than a second threshold) or the number of nodes in multiple computing nodes whose performance indicator matching degree is greater than a certain threshold is less than a certain threshold (such as less than the second threshold), then it can be considered that the load in the multiple computing nodes is relatively balanced, and the third task allocation method can be used to allocate tasks to the first subtask and the tasks in the overloaded computing node so that the load on multiple computing nodes is balanced.

[0101] Step S210 , allocating the first subtask among multiple computing nodes according to the target task allocation method.

[0102] In some embodiments, when a new task is received, dynamic adjustment of the algorithm selection strategy can be triggered to achieve dynamic switching of the algorithm.

[0103] In some embodiments, while dynamically monitoring the load of nodes and tasks, when the system detects changes in performance indicators (for example, excessive load on certain nodes), dynamic adjustment of the algorithm selection strategy is triggered to achieve dynamic switching of the algorithm.

[0104] In the above embodiment, the performance indicator matching degree of the computing node can be determined according to the performance indicator available value on the computing node and the performance indicator requirement value of the existing task, and then the task allocation method that meets the current computing node performance distribution situation can be determined from multiple task allocation methods according to the performance indicator matching degree of each computing node, so as to allocate the subtasks of the target task to each computing node for computing and processing. Through the above method, tasks can be reasonably allocated among multiple computing nodes to achieve load balancing, thereby improving the utilization rate of computing resources.

[0105] Figure 3 The present invention is a flowchart of a method for determining a performance indicator matching degree according to an exemplary embodiment.

[0106] In some embodiments, the plurality of computing nodes in the distributed system may include a target computing node.

[0107] In some embodiments, the above performance indicators may include at least one of CPU, memory, network bandwidth, and I / O performance values.

[0108] refer to Figure 3 , the above performance indicator matching degree determination method may include the following steps.

[0109] Step S302: subtract the CPU available value of the target computing node from the CPU requirement value of the existing task in the target computing node to obtain the CPU matching degree of the target computing node.

[0110] Step S304: subtract the memory available value of the target computing node from the memory requirement value of the existing tasks in the target computing node to obtain the memory matching degree of the target computing node.

[0111] Step S306 : Subtract the bandwidth available value of the target computing node from the bandwidth requirement value of the existing task in the target computing node to obtain the bandwidth matching degree of the target computing node.

[0112] Step S308 , subtract the I / O available value of the target computing node from the I / O demand value of the existing task in the target computing node to obtain the I / O matching degree of the target computing node.

[0113] Step S310, performing weighted sum processing on at least one of the CPU matching degree, the memory matching degree, the bandwidth matching degree, and the I / O matching degree to obtain the performance indicator matching degree of the target computing node.

[0114] Through the above method, a performance indicator matching degree can be obtained, which can describe whether the performance indicators in the target computing node can meet the task requirements.

[0115] In some embodiments, if the performance indicator matching degree of the target computing node is too large (eg, much greater than 0), it indicates that the performance on the target computing node is overloaded and cannot meet the task requirements at all, and at least part of the tasks need to be reallocated.

[0116] In some embodiments, if the performance indicator matching degree of the target computing node is close to 0, it means that the performance indicator in the target computing node just meets the task requirement on the target computing node.

[0117] In some implementations, if the performance index of the target computing node is less than 0, it means that the performance of the target computing node can not only meet the task requirements on the target computing node, but also has more surplus.

[0118] Figure 4 The invention is a flowchart showing a distributed processing method of a task according to an exemplary embodiment.

[0119] refer to Figure 4 The distributed processing method of the above tasks may include the following steps.

[0120] Step S402, adding the performance index matching degree of each computing node to obtain the total value of the remaining performance index.

[0121] Step S404: if the total value of the remaining performance indicators is greater than the first threshold, a first task allocation method is determined as a target task allocation method among multiple task allocation methods, wherein the first task allocation method is used to make the target task continuous and uninterrupted.

[0122] Step S406: If the total value of the remaining performance index is less than or equal to the first threshold value and greater than the second threshold value, a second task allocation method is determined as a target task allocation method among the multiple task allocation methods, wherein the second task allocation method is used to balance the node load when the node performance difference is large. The first threshold value is greater than the second threshold value.

[0123] Step S408: If the total value of the remaining performance indicators is less than or equal to the second threshold, a third task allocation method is determined as a target task allocation method among multiple task allocation methods, wherein the third task allocation method is used to balance the node load when the node performance is balanced.

[0124] In some embodiments, before task scheduling, the distributed system may calculate the performance indicator matching degree based on the performance indicators of the nodes and tasks, and select the most appropriate load balancing algorithm (eg, selecting an appropriate task allocation method) based on the performance indicator matching degree.

[0125] In some embodiments, not only Figure 4 The embodiment shown selects a suitable task allocation method, and a suitable task allocation method can also be selected according to the following method: if the number of nodes whose performance indicator matching degree is greater than a certain threshold (such as a first threshold) among multiple computing nodes exceeds a certain value, it can be considered that there are very many overloaded computing nodes, and the first task allocation method can be used; if the number of nodes whose performance indicator matching degree is greater than a certain threshold among multiple computing nodes is within a certain range (such as less than or equal to the first threshold and greater than the second threshold), it can be considered that the overloaded computing nodes among the multiple computing nodes are within an acceptable range, and the second task allocation method can be used; if the number of nodes whose performance indicator matching degree is greater than a certain threshold among multiple computing nodes is less than a certain threshold (such as less than the second threshold), it is considered that there are fewer overloaded computing nodes and the computing tasks are more balanced, and the third task allocation method can be used.

[0126] Figure 5 is a flowchart of a first task allocation method according to an exemplary embodiment.

[0127] In some embodiments, the target task allocation method may be a first task allocation method.

[0128] refer to Figure 5 , the first task allocation method may include the following steps.

[0129] Step S502: Obtain the target attribute value of the first subtask.

[0130] In some embodiments, the target attribute value can uniquely identify the first subtask, such as a task identifier (ID), task content, request source IP address, etc., which is not limited in this application.

[0131] Step S504: performing a hash calculation on the target attribute value of the first subtask to obtain a target hash value.

[0132] In some embodiments, a preset hash function (such as MD5, SHA-1, SHA-2, etc.) may be used to perform hash mapping on the target attribute value of the first subtask to obtain a target hash value.

[0133] In some embodiments, the target attribute of the first subtask may be mapped to a target hash ring to obtain a target hash value. The target hash ring may include multiple virtual nodes, and each computing node may correspond to at least one virtual node.

[0134] In some embodiments, a virtual node closest to the target hash value may be determined on the target hash ring as the target virtual node, and then a target computing node corresponding to the target virtual node may be found according to a mapping relationship to serve as the first computing node.

[0135] Step S506, performing a modulo process on the node number values ​​of the plurality of computing nodes using the target hash value to obtain a first remainder.

[0136] Step S508: sequentially determine a first computing node from among the plurality of computing nodes according to the first remainder.

[0137] In some embodiments, the first computing node is matched among the plurality of computing nodes according to the first remainder.

[0138] For example, if the first remainder is N, N computing nodes selected from the plurality of computing nodes are used as the first computing nodes, where N is an integer greater than or equal to 1.

[0139] Step S510: Allocate the first subtask to the first computing node for processing.

[0140] In some embodiments, the first subtask may be a newly generated subtask in the target task.

[0141] In some embodiments, the target attribute of the first subtask may be mapped to a target hash ring, which may include multiple virtual nodes, and each computing node may correspond to at least one virtual node.

[0142] For example, the plurality of computing nodes may include a sixth computing node and a seventh computing node, the sixth computing node corresponding to the sixth virtual node on the hash ring, the seventh computing node corresponding to the seventh virtual node on the hash ring, and the seventh virtual node may be the node after the sixth virtual node on the hash ring.

[0143] Assuming that the sixth computing node fails or is overloaded, at least part of the tasks on the sixth computing node can be offloaded to other computing nodes. Then the first subtask can be the subtask offloaded from the sixth computing node.

[0144] In some embodiments, if the first subtask is a subtask unloaded from the sixth computing node, the sixth virtual node corresponding to the sixth computing node can be determined first, and then the sixth virtual node can be destroyed, and then the first subtask can be assigned to the computing node (such as the seventh computing node) corresponding to the next virtual node (such as the seventh virtual node) of the sixth virtual node. Through the above method, multiple computing nodes can be load balanced without interrupting the target task.

[0145] The method provided in the above embodiment can be applied to scenarios that require high availability, and tasks are assigned to nodes through a hash function to improve fault tolerance. The above method can calculate the node index corresponding to the task through a hash function: Node Index = Task Hash Value % Number of Nodes. Among them, Task Hash Value is the hash value of the task, calculated by the hash function hash (task), Number of Nodes is the total number of nodes involved in the scheduling, and %: modulus operator, indicating the remainder. The task will be assigned to the calculated node.

[0146] Figure 6 is a flowchart of a second task allocation method according to an exemplary embodiment.

[0147] In some embodiments, the target task allocation method may be a second task allocation method.

[0148] refer to Figure 6 , the above-mentioned second task allocation method may include the following steps.

[0149] Step S602: Obtain the node weight of each computing node, wherein the node weight is determined according to the matching degree of the performance indicators of each computing node.

[0150] In some embodiments, the weight corresponding to each computing node can be determined according to the inverse ratio of the proportion of the performance index matching degree of each computing node. For example, the proportion of computing nodes with a small performance index matching degree (indicating that there is still a lot of remaining performance) is relatively large; for computing nodes with a high performance index matching degree (indicating that there is relatively little or no remaining performance), the proportion is relatively large.

[0151] In some embodiments, the weight of each computing node can also be determined according to the remaining performance of each computing node, such as determining the weight of each computing node according to the proportion of the remaining performance. Among them, the remaining performance of the computing node can be determined by subtracting the performance indicator requirement value of the existing task from the performance indicator available value of the computing node. In some embodiments, if the remaining performance of the computing node is more, it corresponds to a larger weight, and if the remaining performance of the computing node is less, it corresponds to a smaller weight.

[0152] Step S604, generating a weighted node list according to the node weights of each computing node, wherein the weighted node list includes multiple virtual nodes, wherein one computing node corresponds to one or more virtual nodes, wherein the proportion of the virtual nodes of the computing node in the weighted node list is equal to the node weight of the computing node.

[0153] In some embodiments, a weighted node list may be generated according to the node weight of each computing node, wherein the weighted node list includes multiple virtual nodes, wherein one computing node corresponds to one or more virtual nodes, wherein the proportion of the virtual nodes of each computing node in the weighted node list is equal to the node weight of the computing node. For example, if there are three nodes Node_1, Node_2, and Node_3, and their weights are 3, 1, and 2, respectively, then the virtual nodes in the weighted node list may be as follows: Node_1, Node_1, Node_1, Node_2, Node_3, Node_3... When performing task assignment, the tasks will poll this weighted node list in turn, so that nodes with high weights obtain tasks more frequently.

[0154] Step S606: Obtain the task identifier of the first subtask.

[0155] Step S608: Perform a modulo process on the number of virtual nodes in the weighted node list using the task identifier of the first subtask to obtain a second remainder.

[0156] Step S610: determining a first virtual node in the weighted node list according to the second remainder, wherein the first virtual node corresponds to the second computing node.

[0157] Step S612: Allocate the first subtask to the second computing node for processing.

[0158] The second task allocation method provided in the above embodiment can first determine the weight of the computing node according to the remaining performance of the computing node, and then generate a weighted node list according to the weight of the computing node for task allocation, so that when performing task allocation, the task will poll this weighted node list in turn, so that nodes with high weights can obtain tasks more frequently.

[0159] In some embodiments, the second task allocation method can be applied to scenarios where the computing node load is relatively balanced. The above second task allocation method can allocate tasks to each node in turn, and the specific formula can be as follows: Node Index = Task Index% Number of Nodes. Wherein Task Index is the position index of the task in the task list, Number of Nodes is the total number of nodes involved in the scheduling, and % is a modulo operator, which means to find the remainder. This ensures that tasks are allocated to different nodes in a sequential cycle, which is suitable for load balancing scenarios.

[0160] In some embodiments, the existing tasks in multiple computing nodes may also be dynamically adjusted by the following method.

[0161] 1. Monitoring and triggering: Dynamically adjust the task allocation strategy according to the load situation. Set the load threshold. When the load of the computing node exceeds the first preset threshold or is lower than the second preset threshold, the dynamic adjustment mechanism is triggered.

[0162] The dynamic adjustment mechanism monitors the node load and sets the load threshold to redistribute tasks and expand / reduce nodes. The calculation formula of the load threshold can be: Load Threshold = α × Average Load.

[0163] Wherein, α is the adjustment coefficient, and Average Load is the average load value of all nodes. When α is greater than 1, Load Threshold can be the first preset threshold, and when α is less than the preset value (such as 0.5), Load Threshold can be the second preset threshold.

[0164] 2. Node adjustment: Increase or decrease computing nodes to adapt to changes in load. In some embodiments, automatic expansion can be achieved using container orchestration tools such as Kubernetes.

[0165] In some embodiments, when the node load is greater than the first preset threshold or less than the second preset threshold, the number of nodes can be dynamically adjusted according to the load of the computing node. The calculation formula for the adjusted number of nodes is:

[0166] The Total Load represents the overall load that needs to be distributed to each node, and the Single Node Load Threshold represents the maximum load that each node can bear (in some embodiments, it can be considered that the maximum load that each node can bear is basically the same). Represents a round-up function that ensures that there are enough nodes to handle the total load without exceeding the load threshold of any single node. This ensures that even if some nodes are needed, they are rounded up to the next integer to ensure that the total load is adequately managed.

[0167] In general, when it is monitored that the load of some computing nodes exceeds the first preset threshold or is lower than the preset threshold, the number of computing nodes can be adjusted (such as increasing or reducing), and then the task needs to be allocated in the adjusted computing nodes during the next task allocation.

[0168] Figure 7 The present invention is a flowchart of a computing node adjustment method according to an exemplary embodiment.

[0169] refer to Figure 7 , the above-mentioned computing node adjustment method may include the following steps.

[0170] Step S702: Determine the load value of each computing node according to the performance indicator requirement value of the existing tasks on each computing node.

[0171] Step S704: Obtain a first load threshold and a second load threshold, wherein the first load threshold is greater than an average load value of the plurality of computing nodes, and the second load threshold is less than the average load value.

[0172] Step S706: If there is a third computing node whose load value is greater than the first load threshold among the multiple computing nodes, a new node is added to the multiple computing nodes and the first subtask is distributed among the multiple computing nodes after the new node.

[0173] Step S708: If there is a fourth computing node whose load value is less than the second load threshold among the multiple computing nodes, the fourth computing node is deleted from the multiple computing nodes and the computing tasks on the fourth computing node are reallocated.

[0174] In some embodiments, if there is a fourth computing node among multiple computing nodes whose load value is less than the second load threshold, the fourth computing node is deleted from the multiple computing nodes and the computing tasks on the fourth computing node are reallocated according to the method provided in this application (refer to the task allocation method for the first subtask).

[0175] Through the technical solution provided by the above embodiment, the number of distributed processing nodes of the target task can be adjusted in time and the tasks can be reallocated when the computing nodes are overloaded or unloaded. It can ensure that there are enough computing nodes to process the target task in time, and avoid the waste of resources caused by the idle operation of the computing nodes. It can also adjust the task allocation in time, so as to balance the load of the computing nodes. Through the above method, the computing efficiency of the target task can be improved.

[0176] Figure 8 The figure is a flowchart of a task allocation method according to an exemplary embodiment.

[0177] In some embodiments, before acquiring the first subtask of the target task, the subtasks of the target task may be initially allocated by the following method.

[0178] In some embodiments, the target task may include multiple subtasks, and the multiple subtasks may include a second subtask. Below, this application will take the second subtask as an example to explain how to assign tasks to subtasks of the target task, and other subtasks can be assigned with reference to the assignment method of the second subtask.

[0179] refer to Figure 8 , the above task allocation method may include the following steps.

[0180] Step S802: Obtain the task identifier of the second subtask.

[0181] Step S804: performing a modulo process on the node number values ​​of the plurality of computing nodes using the task identifier of the second subtask to obtain a third remainder.

[0182] Step S806: sequentially determine a fifth computing node corresponding to the second subtask from among the plurality of computing nodes according to the third remainder.

[0183] Step S808: Allocate the second subtask to the fifth computing node for processing.

[0184] The above method can distribute each subtask of the target task to each computing node in sequence for calculation through a polling algorithm, so that the load of each computing node is balanced.

[0185] In some embodiments, the task allocation method may also be selected according to the following method.

[0186] 1. Only one node: If there is only one node, all tasks are assigned to this node, and no complex scheduling algorithm is required.

[0187] 2. The second task allocation method (such as weighted round-robin scheduling algorithm): If weights are provided and the number of weights is equal to the number of nodes but not completely the same, the weighted round-robin scheduling algorithm is used.

[0188] 3. The first task allocation method (such as consistent hash scheduling algorithm): If a hash function is provided, the consistent hash scheduling algorithm is used.

[0189] 4. The third task allocation method (such as polling scheduling algorithm) is used by default: If there are no special conditions, the polling scheduling algorithm is used by default.

[0190] Among them, the weighted polling algorithm is suitable for scenarios with large differences in node performance, and tasks are allocated according to the weights of the nodes.

[0191] In the weighted round-robin scheduling algorithm, a weighted node list weighted_nodesList is first established according to the weight of the node, and the task allocation is calculated by the following formula: Node Index = Task Index % Weighted Node List Length.

[0192] Among them, Task Index is the position index of the task in the task list, Weighted Node ListLength is the length of the weighted node list weighted_nodes, % is the modulus operator, indicating the remainder. The tasks will be assigned to the calculated nodes in turn.

[0193] Polling algorithm: It is suitable for scenarios with relatively balanced loads. Tasks are assigned to each node in turn. The polling scheduling algorithm calculates the node index of the task through the task index and the number of nodes. The specific formula is as follows: Node Index = Task Index % Number of Nodes.

[0194] Among them, Task Index is the position index of the task in the task list, Number of Nodes is the total number of nodes involved in the scheduling, and % is the modulo operator, which means to find the remainder. This ensures that tasks are allocated to different nodes in a sequential cycle, which is suitable for load balancing scenarios. The modulo operation is to find the remainder of the division of two numbers.

[0195] Consistent hashing algorithm: Applicable to scenarios that require high availability. It assigns tasks to nodes through hash functions to improve fault tolerance. The consistent hashing scheduling algorithm calculates the node index corresponding to the task through a hash function: Node Index = Task Hash Value % Number of Nodes.

[0196] Among them, Task Hash Value is the hash value of the task, which is calculated by the hash function hash(task), Number of Nodes is the total number of nodes involved in the scheduling, and % is the modulus operator, which means to find the remainder. The task will be assigned to the calculated node.

[0197] The above embodiment can automatically select the appropriate scheduling strategy (weighted polling, consistent hashing, polling) according to different scene conditions to achieve efficient task allocation. By initializing the task allocation dictionary, selecting the scheduling algorithm according to the condition, and traversing the task list, the task is allocated to the appropriate node to ensure the efficient operation of the system and the rationality of task allocation.

[0198] Fig. 9 The figure is a flowchart of a task allocation method according to an exemplary embodiment.

[0199] refer to Fig. 9 , the above task allocation method may include the following steps.

[0200] Step S901, start the task scheduling process.

[0201] Step S902, initialize an empty dictionary. The empty dictionary can be used to store task allocation. The above dictionary is used to store the computing nodes to be assigned tasks. If the node does not exist in the dictionary, it means that the node is a newly added node.

[0202] Step S903, determine whether to use the weighted round-robin scheduling algorithm.

[0203] If the weighted polling scheduling algorithm is selected, step S904 is executed to create a weighted node list weighted_nodes. First, a weighted node list weighted_nodes is created, and the nodes are repeated according to the weight of each node. Then all tasks are looped through, and the node index is calculated according to the task index i and the length of the weighted node list len(weighted_nodes), and the task is assigned to the corresponding node. Next, the task is added to the task list corresponding to the node, and finally the weighted polling scheduling algorithm is terminated.

[0204] If the weighted round-robin scheduling algorithm is not selected, step S905 is executed to determine whether to use the consistent hash scheduling algorithm.

[0205] If the consistent hash scheduling algorithm is used, step S906 is executed to traverse the task list and calculate the node index using the hash function. First, all tasks are looped through, the node index corresponding to the task is calculated using the hash function, and the task is assigned to the calculated node. Then, the task is added to the task list corresponding to the node, and finally the consistent hash scheduling algorithm is terminated.

[0206] If the consistent hash scheduling algorithm is not selected, step S907 is executed, and polling scheduling is used to traverse the task list and calculate the node index. In some embodiments, the polling scheduling algorithm is used by default. First, all tasks are looped through, and the node index is calculated according to the task index i and the number of nodes len(nodes), and the task is assigned to the corresponding node. Then, the task is added to the task list corresponding to the node, and finally the polling scheduling algorithm is terminated.

[0207] Step S908, obtaining tasks to be assigned.

[0208] Step S909: Calculate the node corresponding to the task according to the hash function or the polling algorithm or the weighted polling algorithm. Obtain a single task to be assigned, and determine the computing node of the task to be assigned according to the task assignment algorithm selected above.

[0209] Step S910, determining whether the node is in the dictionary.

[0210] If the node is in the dictionary, execute step S912.

[0211] If the node is not in the dictionary, it means that the node is a newly added node, and step S911 is executed.

[0212] Step S911, initializing an empty list for a node. In some embodiments, an empty list may be initialized for a node so as to assign a task to the node.

[0213] Step S912: adding the task to be assigned to the task list of the current node.

[0214] In some embodiments, the task scheduling algorithm can be optimized by the following method to improve load balancing efficiency.

[0215] The evaluation formula for the efficiency of the scheduling algorithm is:

[0216] Scheduling Algorithm Efficiency = Number of Successfully Scheduled Tasks / Total Number of Tasks.

[0217] The Number of Successfully Scheduled Tasks is the number of tasks that are successfully scheduled and completed, and the Total Number of Tasks is the total number of tasks that need to be scheduled. This formula is used to evaluate the effectiveness of the scheduling strategy and ensure the efficient operation of the system and the rational use of resources by regularly adjusting parameters and strategies.

[0218] The embodiments provided in this application have the following beneficial effects:

[0219] 1. Improve computing resource utilization: Through dynamic load balancing algorithms, ensure that the resources of all computing nodes are fully utilized to avoid resource waste.

[0220] 2. Improve training efficiency: Improve training speed and shorten model development cycle through reasonable task allocation and node expansion.

[0221] 3. Improve system adaptability: Through dynamic adjustment mechanism, timely respond to load changes to ensure system stability and adaptability.

[0222] The technical solution provided by this application can not only allocate tasks based on real-time monitoring data in combination with different load balancing algorithms (polling, weighted polling, consistent hashing), select appropriate algorithms to cope with different load conditions and node performance differences, and ensure reasonable task allocation; it can also provide flexible node expansion and dynamic adjustment mechanisms: using container orchestration tools such as Kubernetes, dynamically increase or decrease computing nodes according to load changes, realize automatic expansion and reduction of nodes, and adapt to real-time load changes. By real-time monitoring data, setting load thresholds, triggering dynamic adjustment mechanisms when the load exceeds or falls below the threshold, dynamically adjusting task allocation strategies and the number of nodes, and ensuring system stability and adaptability.

[0223] It should be particularly pointed out that the various steps in the various embodiments of the distributed processing method of the above tasks can be mutually crossed, replaced, added, or deleted. Therefore, these reasonable permutations, combinations, and transformations of the distributed processing method of tasks should also fall within the scope of protection of the present disclosure, and the scope of protection of the present disclosure should not be limited to the embodiments.

[0224] Based on the same inventive concept, the present disclosure also provides a distributed processing device for tasks, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0225] Fig.10 FIG. 1 is a block diagram of a distributed processing device for a task according to an exemplary embodiment. Fig.10 The distributed processing device 1000 for tasks provided by the embodiment of the present disclosure may include: a subtask acquisition module 1001, a performance indicator acquisition module 1002, a performance indicator matching degree determination module 1003, a target task allocation method determination module 1004, and a task allocation module 1005.

[0226] Among them, the subtask acquisition module 1001 can be used to acquire the first subtask of the target task; the performance indicator acquisition module 1002 can be used to acquire the available performance indicator values ​​of each computing node and the performance indicator requirement values ​​of the existing tasks on each computing node; the performance indicator matching degree determination module 1003 can be used to determine the performance indicator matching degree of each computing node based on the available performance indicator values ​​of each computing node and the performance indicator requirement values ​​of the existing tasks on each computing node; the target task allocation method determination module 1004 can be used to determine the target task allocation method among multiple task allocation methods based on the performance indicator matching degree of each computing node; the task allocation module 1005 can be used to allocate the first subtask among multiple computing nodes according to the target task allocation method.

[0227] It should be noted that the above subtask acquisition module 1001, performance indicator acquisition module 1002, performance indicator matching degree determination module 1003, target task allocation method determination module 1004, and task allocation module 1005 correspond to S202 to S210 in the method embodiment, and the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above method embodiment. It should be noted that the above modules as part of the device can be executed in a computer system such as a set of computer executable instructions.

[0228] In some embodiments, the plurality of computing nodes include a target computing node, wherein the performance indicator includes at least one of a CPU, a memory, a network bandwidth, and an I / O performance value; wherein, the performance indicator matching degree of each computing node is determined according to the performance indicator available value of each computing node and the performance indicator requirement value of an existing task on each computing node, including: subtracting the CPU available value of the target computing node from the CPU requirement value of the existing task in the target computing node to obtain the CPU matching degree of the target computing node; subtracting the memory available value of the target computing node from the memory requirement value of the existing task in the target computing node to obtain the memory matching degree of the target computing node; subtracting the bandwidth available value of the target computing node from the bandwidth requirement value of the existing task in the target computing node to obtain the bandwidth matching degree of the target computing node; subtracting the I / O available value of the target computing node from the I / O requirement value of the existing task in the target computing node to obtain the I / O matching degree of the target computing node; performing weighted sum processing on at least one of the CPU matching degree, the memory matching degree, the bandwidth matching degree, and the I / O matching degree to obtain the performance indicator matching degree of the target computing node.

[0229] In some embodiments, the target task allocation method determination module 1004 may include: a total value determination submodule, a first judgment submodule, a second judgment submodule, and a third judgment submodule.

[0230] Among them, the total value determination submodule is used to add the performance indicator matching degrees of each computing node to obtain the total value of the remaining performance indicators; the first judgment submodule is used to determine the first task allocation method as the target task allocation method among multiple task allocation methods if the total value of the remaining performance indicators is greater than the first threshold, wherein the first task allocation method is used to make the target task continuous and uninterrupted; the second judgment submodule is used to determine the second task allocation method as the target task allocation method among multiple task allocation methods if the total value of the remaining performance indicators is less than or equal to the first threshold and greater than the second threshold, wherein the second task allocation method is used to balance the node load when the node performance difference is large; wherein the first threshold is greater than the second threshold; the third judgment submodule is used to determine the third task allocation method as the target task allocation method among multiple task allocation methods if the total value of the remaining performance indicators is less than or equal to the second threshold, wherein the third task allocation method is used to balance the node load when the node performance is balanced.

[0231] In some embodiments, the target task allocation method is a first task allocation method; wherein the task allocation module 1005 may include: an attribute value acquisition submodule, a hash value determination submodule, a first remainder determination submodule, a first computing node determination submodule and a first allocation submodule.

[0232] Among them, the attribute value acquisition submodule is used to obtain the target attribute value of the first subtask; the hash value determination submodule is used to perform hash calculation on the target attribute value of the first subtask to obtain the target hash value; the first remainder determination submodule is used to perform modulo processing on the node number values ​​of multiple computing nodes through the target hash value to obtain the first remainder; the first computing node determination submodule is used to sequentially determine the first computing node among multiple computing nodes according to the first remainder; the first allocation submodule is used to allocate the first subtask to the first computing node for processing.

[0233] In some embodiments, the target task allocation method is a second task allocation method; wherein the task allocation module 1005 may include: a weight acquisition submodule, a weighted node list determination submodule, a task identifier acquisition submodule, a second remainder determination submodule, a second computing node determination submodule, and a second allocation submodule.

[0234] Among them, the weight acquisition submodule is used to obtain the node weight of each computing node, wherein the node weight is determined according to the matching degree of the performance indicators of each computing node; the weighted node list determination submodule is used to generate a weighted node list according to the node weight of each computing node, the weighted node list includes multiple virtual nodes, one computing node corresponds to one or more virtual nodes, wherein the proportion of the virtual nodes of the computing node in the weighted node list is equal to the node weight of the computing node; the task identifier acquisition submodule is used to obtain the task identifier of the first subtask; the second remainder determination submodule is used to perform modulo processing on the number of virtual nodes in the weighted node list through the task identifier of the first subtask to obtain the second remainder; the second computing node determination submodule is used to determine the first virtual node in the weighted node list according to the second remainder, wherein the first virtual node corresponds to the second computing node; the second allocation submodule is used to allocate the first subtask to the second computing node for processing.

[0235] In some embodiments, the distributed processing device 1000 may further include: a node load determination module, a load threshold acquisition module, a node addition module, and a node reduction module.

[0236] Among them, the node load determination module is used to determine the load value of each computing node according to the performance indicator requirement value of the existing tasks on each computing node; the load threshold acquisition module is used to obtain a first load threshold and a second load threshold, wherein the first load threshold is greater than the average load value of multiple computing nodes, and the second load threshold is less than the average load value; the node addition module is used to add a new node to the multiple computing nodes if there is a third computing node with a load value greater than the first load threshold among the multiple computing nodes, and to distribute the first subtask among the multiple computing nodes after the newly added node; the node reduction module is used to delete the fourth computing node from the multiple computing nodes and reallocate the computing tasks on the fourth computing node if there is a fourth computing node with a load value less than the second load threshold among the multiple computing nodes.

[0237] In some embodiments, the target task includes multiple subtasks, and the multiple subtasks include a second subtask; wherein, before obtaining the first subtask of the target task, the distributed processing device 1000 may also include: a subtask identification acquisition module, a third remainder acquisition module, a fifth computing node acquisition module and a third allocation module.

[0238] Among them, the subtask identifier acquisition module can be used to obtain the task identifier of the second subtask; the third remainder acquisition module can be used to perform modulo processing on the node number values ​​of multiple computing nodes through the task identifier of the second subtask to obtain a third remainder; the fifth computing node acquisition module can be used to sequentially determine the fifth computing node corresponding to the second subtask among multiple computing nodes according to the third remainder; the third allocation module can be used to allocate the second subtask to the fifth computing node for processing.

[0239] Since the functions of the device 1000 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.

[0240] The modules and / or submodules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The modules and / or submodules described may also be arranged in a processor. The names of these modules and / or submodules do not, in certain cases, constitute limitations on the modules and / or submodules themselves.

[0241] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a part of a module or program segment, and a part of the above-mentioned module or program segment contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer program instructions.

[0242] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0243] Fig.11 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Fig.11 The electronic device 1100 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0244] like Fig.11 As shown, the electronic device 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the electronic device 1100 are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0245] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0246] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains computer program instructions for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, the above-mentioned functions defined in the system of the present disclosure are executed.

[0247] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable computer program instructions. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The computer program instructions contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0248] As another aspect, the present disclosure also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by a device, the device can implement functions including: obtaining the first subtask of the target task; obtaining the performance indicator available values ​​of each computing node and the performance indicator required values ​​of the existing tasks on each computing node; determining the performance indicator matching degree of each computing node according to the performance indicator available values ​​of each computing node and the performance indicator required values ​​of the existing tasks on each computing node; determining the target task allocation method among multiple task allocation methods according to the performance indicator matching degree of each computing node; and assigning the first subtask to multiple computing nodes according to the target task allocation method.

[0249] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer program instructions, the computer program instructions being stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the methods provided in various optional implementations of the above embodiments.

[0250] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of computer program instructions for enabling an electronic device (which can be a server or a terminal device, etc.) to execute the method according to the embodiment of the present disclosure.

[0251] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims. It should be understood that the present disclosure is not limited to the detailed structures, drawings or implementation methods shown herein, but rather, the present disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.

Claims

1. A distributed processing method for tasks, characterized in that: Distributed processing of target tasks is performed by multiple computing nodes, wherein the method comprises: Obtaining the first subtask of the target task; Obtain the available values ​​of the performance indicators of each computing node and the required values ​​of the performance indicators of the existing tasks on each computing node; Determine the performance indicator matching degree of each computing node according to the available value of the performance indicator of each computing node and the performance indicator requirement value of the existing tasks on each computing node; According to the matching degree of the performance indicators of each computing node, a target task allocation method is determined among multiple task allocation methods; The first subtask is distributed among the multiple computing nodes according to the target task distribution method.

2. The method according to claim 1, characterized in that: The multiple computing nodes include a target computing node, wherein the performance indicator includes at least one of a CPU, a memory, a network bandwidth, and an I / O performance value; wherein, according to the available value of the performance indicator of each computing node and the required value of the performance indicator of the existing task on each computing node, determining the performance indicator matching degree of each computing node includes: Subtract the CPU available value of the target computing node from the CPU requirement value of the existing tasks in the target computing node to obtain the CPU matching degree of the target computing node; Subtracting the available memory value of the target computing node from the memory requirement value of the existing tasks in the target computing node to obtain the memory matching degree of the target computing node; Subtracting the bandwidth available value of the target computing node from the bandwidth requirement value of the existing task in the target computing node to obtain the bandwidth matching degree of the target computing node; Subtracting the I / O available value of the target computing node from the I / O demand value of the existing task in the target computing node to obtain the I / O matching degree of the target computing node; A weighted sum process is performed on at least one of the CPU matching degree, the memory matching degree, the bandwidth matching degree, and the I / O matching degree to obtain a performance indicator matching degree of the target computing node.

3. The method according to claim 2, characterized in that: According to the matching degree of performance indicators of each computing node, a target task allocation method is determined from multiple task allocation methods, including: Add the performance index matching degree of each computing node to obtain the total value of the remaining performance index; If the total value of the remaining performance indicators is greater than a first threshold, determining a first task allocation method among the multiple task allocation methods as the target task allocation method, wherein the first task allocation method is used to make the target task continuous and uninterrupted; If the total value of the remaining performance indicators is less than or equal to the first threshold value and greater than a second threshold value, a second task allocation method is determined as the target task allocation method among the multiple task allocation methods, wherein the second task allocation method is used to balance the node load when the node performance difference is large; wherein the first threshold value is greater than the second threshold value; If the total value of the remaining performance indicators is less than or equal to the second threshold, a third task allocation method is determined as the target task allocation method among the multiple task allocation methods, wherein the third task allocation method is used to balance the node load when the node performance is balanced.

4. The method according to claim 1, characterized in that: The target task allocation method is a first task allocation method; wherein, according to the target task allocation method, the first subtask is allocated among the multiple computing nodes, including: Obtaining a target attribute value of the first subtask; Performing hash calculation on the target attribute value of the first subtask to obtain a target hash value; Performing a modulo process on the node number values ​​of the plurality of computing nodes by using the target hash value to obtain a first remainder; sequentially determining a first computing node among the plurality of computing nodes according to the first remainder; The first subtask is assigned to the first computing node for processing.

5. The method according to claim 1, characterized in that: The target task allocation method is a second task allocation method; wherein, according to the target task allocation method, the first subtask is allocated among the multiple computing nodes, including: Obtaining a node weight of each computing node, wherein the node weight is determined according to a matching degree of performance indicators of each computing node; Generate a weighted node list according to the node weight of each computing node, wherein the weighted node list includes multiple virtual nodes, wherein one computing node corresponds to one or more virtual nodes, wherein the proportion of the virtual nodes of the computing node in the weighted node list is equal to the node weight of the computing node; Obtaining a task identifier for the first subtask; Performing a modulo process on the number of virtual nodes in the weighted node list according to the task identifier of the first subtask to obtain a second remainder; Determine a first virtual node in the weighted node list according to the second remainder, wherein the first virtual node corresponds to the second computing node; The first subtask is assigned to the second computing node for processing.

6. The method according to claim 1, characterized in that: The method further comprises: Determine the load value of each computing node based on the performance indicator requirement value of the existing tasks on each computing node; Acquire a first load threshold and a second load threshold, wherein the first load threshold is greater than an average load value of the plurality of computing nodes, and the second load threshold is less than the average load value; If there is a third computing node among the multiple computing nodes whose load value is greater than the first load threshold, adding a new node to the multiple computing nodes and performing task allocation of the first subtask among the multiple computing nodes after the newly added node; If there is a fourth computing node whose load value is less than the second load threshold among the multiple computing nodes, the fourth computing node is deleted from the multiple computing nodes and the computing tasks on the fourth computing node are reallocated.

7. The method according to claim 1, characterized in that: The target task includes a plurality of subtasks, and the plurality of subtasks include a second subtask; wherein, before acquiring the first subtask of the target task, the method further includes: Obtaining a task identifier for the second subtask; Performing a modulo process on the node number values ​​of the plurality of computing nodes according to the task identifier of the second subtask to obtain a third remainder; sequentially determining a fifth computing node corresponding to the second subtask from among the plurality of computing nodes according to the third remainder; The second subtask is assigned to the fifth computing node for processing.

8. A distributed processing device for tasks, characterized in that: Distributed processing of target tasks through multiple computing nodes, including: A subtask acquisition module, used to acquire the first subtask of the target task; The performance indicator acquisition module is used to obtain the available performance indicator values ​​of each computing node and the performance indicator requirement values ​​of the existing tasks on each computing node; The performance indicator matching degree determination module is used to determine the performance indicator matching degree of each computing node according to the available value of the performance indicator of each computing node and the performance indicator requirement value of the existing tasks on each computing node; A target task allocation method determination module is used to determine a target task allocation method from multiple task allocation methods according to the performance indicator matching degree of each computing node; A task allocation module is used to allocate the first subtask among the multiple computing nodes according to the target task allocation method.

9. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer program instructions; the processor calls the computer program instructions stored in the memory to implement the distributed processing method of the task as described in any one of claims 1-7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, a distributed processing method for tasks as described in any one of claims 1 to 7 is implemented.

11. A computer program product, comprising computer program instructions, wherein the computer program instructions are stored in a computer-readable storage medium, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Task allocation method and device, electronic equipment and computer readable medium

    CN113342665A

  • Supercomputing job scheduling method and device, electronic equipment and storage medium

    CN117076119A

  • Method for scheduling cloud-computing resource and system applying the same

    US20110202657A1

Cited By

  • Database comparison task scheduling method and device and medium

    CN120849066A