Task execution method, device, apparatus, storage medium, and program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2026-08-11
AI Technical Summary
相关技术中,数据计算系统在处理各类计算任务时多采用集中式的处理方式,然而这种处理方式不仅效率低下,还会因大量数据的传输而导致网络拥堵和延迟,导致任务处理效率低下
[0057]本申请实施例提供的任务执行方法,在获取到待执行的计算任务后,通过对该计算任务进行拆分,并将拆分后的各个子任务分配给对应的目标计算节点进行处理,可以确保任务处理过程中仅传输必要的数据,如此,可以有效降低数据传输量,提升任务处理效率;另外,上述分布式计算方式能够应对各种不同类型的数据源和复杂的数据处理需求,具有一定的灵活性和适应性。
Smart Images

Figure CN122547508A_ABST
Abstract
Description
Technical Field
[0001] This application relates to data processing technology, and more particularly to a task execution method, apparatus, computer-readable storage medium, and computer program product. Background Technology
[0002] In today's digital age, data is being generated and distributed increasingly widely and dispersed. In related technologies, data computing systems often employ centralized processing methods when handling various computing tasks. However, this approach is not only inefficient but also leads to network congestion and latency due to the transmission of large amounts of data, further reducing task processing efficiency. Summary of the Invention
[0003] This application provides a task execution method, apparatus, computer-readable storage medium, and computer program product, which can improve task processing efficiency.
[0004] The technical solution of this application embodiment is implemented as follows:
[0005] This application provides a task execution method applied to a computing management device in a computing network, wherein the computing network further includes: multiple computing nodes, and the method includes:
[0006] Obtain the computational tasks to be executed;
[0007] If it is determined that the computing task needs to be split, the computing task is split, and after each split subtask is obtained, the target operator corresponding to the subtask is determined, and the target computing node for executing the subtask is determined from the plurality of computing nodes according to the target operator.
[0008] The corresponding subtasks are executed using the determined target computing node until all the split subtasks have been executed, and the execution result of the computing task is obtained.
[0009] In the above scheme, determining the target computing node for executing the subtask from the plurality of computing nodes based on the target operator includes:
[0010] Based on the target operator, determine whether there are multiple candidate computing nodes among the plurality of computing nodes capable of executing the subtask;
[0011] If it is determined that there are multiple candidate computing nodes capable of executing the subtask, a target computing node for executing the subtask is determined from the multiple candidate computing nodes according to the task allocation strategy.
[0012] In the above scheme, determining the target computing node for executing the subtask from the plurality of candidate computing nodes according to the task allocation strategy includes:
[0013] Obtain the current load information of the multiple candidate computing nodes;
[0014] Based on the current load information of the multiple candidate computing nodes, determine the candidate computing node with the lowest current load from among the multiple candidate computing nodes;
[0015] The candidate computing node with the lowest current load is determined as the target computing node for executing the subtask.
[0016] In the above scheme, determining the target computing node for executing the subtask from the plurality of candidate computing nodes according to the task allocation strategy includes:
[0017] Candidate computing nodes with hardware accelerators are determined from the plurality of candidate computing nodes;
[0018] The candidate computing node with the hardware accelerator is determined as the target computing node for executing the subtask.
[0019] In the above scheme, the computing network further includes a data source unit; the step of determining the target computing node for executing the subtask from the plurality of candidate computing nodes according to the task allocation strategy includes:
[0020] The candidate computing node where the data source unit is located is determined from the plurality of candidate computing nodes; the data source unit is used to acquire data related to the computing task;
[0021] The candidate computing node where the data source unit is located is determined as the target computing node for executing the subtask.
[0022] In the above scheme, after obtaining the computational task to be executed, the method further includes:
[0023] The computation task is parsed to obtain the set of operators corresponding to the computation task;
[0024] Based on the set of operators corresponding to the computation task, determine whether the computation task needs to be split.
[0025] In the above scheme, the operator set includes multiple operators, and determining whether the computation task needs to be split based on the operator set corresponding to the computation task includes:
[0026] The multiple operators corresponding to the computing task are matched with the preset operator sets corresponding to each computing node to obtain the matching results;
[0027] Based on the matching results, determine whether the computation task needs to be split.
[0028] This application embodiment also provides a task execution device, applied to a computing management device in a computing network, wherein the computing network further includes multiple computing nodes, and the task execution device includes:
[0029] The acquisition module is used to acquire computational tasks to be executed.
[0030] The determination module is used to split the computing task when it is determined that the computing task needs to be split, and after obtaining each split subtask, determine the target operator corresponding to the subtask, and determine the target computing node for executing the subtask from the plurality of computing nodes according to the target operator;
[0031] The execution module is used to execute the corresponding subtasks using the determined target computing node until all the split subtasks have been executed and the execution result of the computing task is obtained.
[0032] In the above scheme, the determining module is further configured to:
[0033] Based on the target operator, determine whether there are multiple candidate computing nodes among the plurality of computing nodes capable of executing the subtask;
[0034] If it is determined that there are multiple candidate computing nodes capable of executing the subtask, a target computing node for executing the subtask is determined from the multiple candidate computing nodes according to the task allocation strategy.
[0035] In the above scheme, the determining module is further configured to:
[0036] Obtain the current load information of the multiple candidate computing nodes;
[0037] Based on the current load information of the multiple candidate computing nodes, determine the candidate computing node with the lowest current load from among the multiple candidate computing nodes;
[0038] The candidate computing node with the lowest current load is determined as the target computing node for executing the subtask.
[0039] In the above scheme, the determining module is further configured to:
[0040] Candidate computing nodes with hardware accelerators are determined from the plurality of candidate computing nodes;
[0041] The candidate computing node with the hardware accelerator is determined as the target computing node for executing the subtask.
[0042] In the above scheme, the computing network further includes a data source unit; the determining module is also used for:
[0043] The candidate computing node where the data source unit is located is determined from the plurality of candidate computing nodes; the data source unit is used to acquire data related to the computing task;
[0044] The candidate computing node where the data source unit is located is determined as the target computing node for executing the subtask.
[0045] In the above scheme, after obtaining the computational task to be executed, the determining module is further configured to:
[0046] The computation task is parsed to obtain the set of operators corresponding to the computation task;
[0047] Based on the set of operators corresponding to the computation task, determine whether the computation task needs to be split.
[0048] In the above scheme, the determining module is further configured to:
[0049] The multiple operators corresponding to the computing task are matched with the preset operator sets corresponding to each computing node to obtain the matching results;
[0050] Based on the matching results, determine whether the computation task needs to be split.
[0051] This application embodiment also provides a task execution device, the task execution device comprising:
[0052] Memory is used to store executable instructions for a computer;
[0053] A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the task execution method as described in any of the preceding claims.
[0054] This application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the task execution method as described in any of the preceding claims.
[0055] This application also provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, can implement the task execution method as described in any of the preceding claims.
[0056] The embodiments of this application have the following beneficial effects:
[0057] The task execution method provided in this application, after obtaining the computing task to be executed, splits the computing task and assigns each of the split sub-tasks to the corresponding target computing nodes for processing. This ensures that only necessary data is transmitted during task processing, thereby effectively reducing the amount of data transmitted and improving task processing efficiency. In addition, the above-mentioned distributed computing method can cope with various types of data sources and complex data processing needs, and has a certain degree of flexibility and adaptability. Attached Figure Description
[0058] Figure 1 A flowchart illustrating a task execution method provided in an embodiment of this application;
[0059] Figure 2 A schematic diagram of a computing network structure is provided for an embodiment of this application;
[0060] Figure 3 This is a schematic diagram of the structure of the task execution device provided in the embodiments of this application;
[0061] Figure 4 This is a schematic diagram of the structure of the task execution device provided in the embodiments of this application. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0064] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0065] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0066] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0067] Data computing systems in related technologies often employ a centralized processing approach when handling various computing tasks. However, this approach is not only inefficient but also leads to network congestion and delays due to the transmission of large amounts of data, resulting in low task processing efficiency.
[0068] Based on the above technical problems, embodiments of this application provide a task execution method, apparatus, computer-readable storage medium, and computer program product.
[0069] Figure 1 This is a flowchart illustrating a task execution method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps:
[0070] S101. Obtain the computational tasks to be executed.
[0071] The task execution method provided in this application embodiment is applicable to scenarios that require processing various computing tasks. For example, the execution subject of the task execution method is a computing management device in a computing network. The computing network, also known as a distributed computing network, may include multiple computing nodes, which can be connected through the network. The computing management device may run in one of the computing nodes.
[0072] Here, the deployment location of each computing node in the computing network is not specifically limited. For example, it can be deployed on the cloud side or on the terminal side; for example, the terminal side can be a vehicle terminal or a mobile terminal, etc.
[0073] In this embodiment, each computing node in the computing network has a built-in general-purpose computing unit for undertaking computing tasks. The computing network may also include a data source unit deployed in one of the computing nodes, which provides a data acquisition interface (get) and a data listening interface (sub). The data acquisition interface is used to actively acquire data related to the computing task, and the data listening interface (sub) is used to listen to data related to the computing task. For ease of understanding, the following describes... Figure 2 An example is provided.
[0074] For example, see Figure 2 In a computing network comprising compute node A, compute node B, and compute node C, the compute management device (ComputeManager) runs on compute node A. Compute nodes A, B, and C each have a built-in general-purpose computing unit, namely compute unit ComputeSink_A, compute unit ComputeSink_B, and compute unit ComputeSink_C, respectively. The data source unit DataSource_B is deployed on compute node B and is used to provide a data acquisition interface (get) and a data listening interface (sub).
[0075] In this embodiment, after the computing task to be executed is loaded by the computing management device, the computing management device obtains the computing task. The computing task to be executed refers to the computing task that needs to be executed, which can be set according to business requirements. The computing task can describe the data computing logic to be performed, which data to process, and the triggered behavior operations, etc. For example, the computing task can be to calculate the average temperature when the vehicle battery exceeds the set temperature, and send an alarm message if the average temperature within the set time still exceeds the set temperature. The computing task can also be to send an alarm message when the vehicle speed is greater than the set speed.
[0076] S102. If it is determined that the computation task needs to be split, the computation task is split, and after each split subtask is obtained, the target operator corresponding to the subtask is determined. Based on the target operator, the target computation node for executing the subtask is determined from multiple computation nodes.
[0077] In this embodiment of the application, after obtaining the computing task to be executed, the computing management device can determine whether the computing task needs to be split. If it is determined that the computing task needs to be split, the computing task is split and subsequent processing is performed; otherwise, if it is determined that the computing task does not need to be split, the current process ends.
[0078] In some embodiments, determining whether a computation task needs to be split may include: parsing the computation task to obtain a set of operators corresponding to the computation task; and determining whether the computation task needs to be split based on the set of operators corresponding to the computation task.
[0079] In this embodiment of the application, after the computing management device obtains the computing task to be executed, it can first parse the computing task to obtain the set of operators corresponding to the computing task. The set of operators contains all the operators required to complete the computing task. The number of operators in the set of operators can be one or more. When the set of operators includes multiple operators, the types of each operator are different.
[0080] Here, the type of each operator in the operator set is not specifically limited; for example, it can be a logical judgment operator, such as greater than, less than, or equal to; it can also be a statistical operator, such as sum, average, maximum, or minimum; it can also be a user-defined operator used for complex operations such as machine learning or deep learning.
[0081] Understandably, if the set of operators corresponding to a computation task contains only one operator, then there is no need to split the computation task, because the computation task only needs one computation node that supports that operator to process it. The following examples illustrate the case where the set of operators contains multiple operators.
[0082] For example, when the operator set includes multiple operators, determining whether the computation task needs to be split based on the operator set corresponding to the computation task may include: matching the multiple operators corresponding to the computation task with the preset operator sets corresponding to each computation node to obtain the matching result; and determining whether the computation task needs to be split based on the matching result.
[0083] Here, the set of preset operators corresponding to each computing node refers to the set of operators supported by the computing units built into each computing node; the set of preset operators can be configured according to business requirements, and can include multiple preset operators. A preset operator refers to an operator that can perform calculations in the computing unit; for example, the type of each preset operator in the set of preset operators can refer to the type of each operator in the above set of operators, which will not be repeated here.
[0084] It should be noted that the preset operator sets corresponding to different computing nodes can be the same or different; for example, see [link to example]. Figure 2 In a computing network consisting of computing nodes A, B, and C, the preset operator set corresponding to computing node A includes greater than, less than, and equal to; the preset operator set corresponding to computing node B is the same as that corresponding to computing node A; and the preset operator set corresponding to computing node C includes sum, average, maximum, and minimum.
[0085] In this embodiment of the application, after obtaining multiple operators corresponding to the computation task according to the above analysis steps, the multiple operators can be matched with the preset operator sets corresponding to each computation node to obtain the matching result. At this time, the matching result can characterize the matching situation between the multiple operators corresponding to the computation task and the multiple preset operator sets. It should be noted that if a certain operator corresponding to the computation task matches a certain preset operator set, it means that the preset operator set includes the operator corresponding to the computation task; otherwise, it means that the preset operator set does not include the operator corresponding to the computation task.
[0086] For example, the matching results mentioned above include matching results corresponding to each of the multiple operators, wherein the matching result corresponding to each operator indicates whether there is a preset set of operators that matches that operator; if it is determined from the matching results corresponding to the multiple operators that there are different preset sets of operators that match at least two of the multiple operators, then it is determined that the computation task needs to be split; otherwise, if it is determined from the matching results corresponding to the multiple operators that there is no preset set of operators that matches any of the multiple operators or that there is only a preset set of operators that matches one of the multiple operators, then it is determined that the computation task does not need to be split and the current process ends.
[0087] Furthermore, if it is determined from the matching results that the computation task needs to be split, the computation task can be split according to at least two target operators among multiple operators to obtain at least two sub-tasks that have a sequential execution order.
[0088] For example, the implementation of splitting a computation task based on at least two target operators can be as follows: split the computation task according to the number and order of at least two target operators; it should be noted that each subtask after splitting corresponds to one target operator, and the execution order of the subtasks corresponding to the target operators that are ranked earlier is before the execution order of the subtasks corresponding to the target operators that are ranked later.
[0089] For example, since each subtask has a corresponding target operator, after each split subtask is obtained, the target operator corresponding to the subtask can be determined, and then the target computing node for executing the subtask can be determined from multiple computing nodes according to the target operator; the target computing node is one of the multiple computing nodes.
[0090] In some embodiments, determining the target computing node for executing the subtask from multiple computing nodes based on the target operator may include: determining whether there are multiple candidate computing nodes capable of executing the subtask among the multiple computing nodes based on the target operator; and, if it is determined that there are multiple candidate computing nodes capable of executing the subtask, determining the target computing node for executing the subtask from the multiple candidate computing nodes according to a task allocation strategy.
[0091] In this embodiment, it can be first determined whether there are multiple candidate computing nodes capable of executing the subtask among multiple computing nodes based on the target operator corresponding to the subtask. Correspondingly, for each computing node among multiple computing nodes, it can be determined whether there is a target operator corresponding to the subtask in its corresponding preset operator set. If it exists, it means that the computing node can execute the subtask. At this time, the computing node can be determined as a candidate computing node, and the above judgment can be continued for the next computing node. If it does not exist, it means that the computing node cannot execute the subtask, and the above judgment can be continued for the next computing node until all computing nodes have been judged.
[0092] For example, by performing the above judgment on the preset operator set corresponding to each computing node, each candidate computing node capable of executing the subtask can be determined from multiple computing nodes. If it is determined that there are multiple candidate computing nodes capable of executing the subtask among multiple computing nodes, the target computing node for executing the subtask can be determined from multiple candidate computing nodes according to the task allocation strategy. Here, the target computing node is one of the multiple candidate computing nodes. Conversely, if it is determined that there is only one candidate computing node capable of executing the subtask among multiple computing nodes, it means that the candidate computing node is the only node for executing the subtask. In this case, the candidate computing node can be directly determined as the target computing node for executing the subtask.
[0093] In some embodiments, determining the target computing node for executing a subtask from multiple candidate computing nodes according to a task allocation strategy may include: obtaining the current load information of multiple candidate computing nodes; determining the candidate computing node with the lowest current load from multiple candidate computing nodes based on the current load information of multiple candidate computing nodes; and determining the candidate computing node with the lowest current load as the target computing node for executing the subtask.
[0094] For example, the task allocation strategy may include an allocation strategy related to node load; the current load information may include the central processing unit (CPU) utilization rate, memory utilization rate, etc., which can characterize the current load of each candidate computing node.
[0095] In this embodiment of the application, when it is determined that there are multiple candidate computing nodes among multiple computing nodes that can execute subtasks, the current load information of multiple candidate computing nodes can be obtained; then, the current load information between each candidate computing node is compared to obtain a comparison result; the comparison result can characterize the size relationship of the current load of each candidate computing node; further, the candidate computing node with the smallest current load can be determined from multiple candidate computing nodes according to the comparison result, and the candidate computing node with the smallest current load can be determined as the target computing node for executing subtasks.
[0096] Understandably, in the embodiments of this application, when multiple candidate computing nodes are able to execute subtasks, the subtasks are preferentially assigned to the computing node with the lowest current load, i.e. the one that is currently more idle, so as to achieve load balancing of each computing node while ensuring task processing efficiency.
[0097] In some embodiments, determining the target computing node for executing a subtask from multiple candidate computing nodes according to a task allocation strategy may include: determining a candidate computing node with a hardware accelerator from multiple candidate computing nodes; and determining the candidate computing node with the hardware accelerator as the target computing node for executing the subtask.
[0098] For example, the task allocation strategy may also include an allocation strategy related to a hardware accelerator; wherein, a hardware accelerator refers to a dedicated hardware module set up to improve task processing efficiency; the hardware accelerator is used to perform certain operations of the task during task processing to improve task processing efficiency.
[0099] In this embodiment of the application, the type of hardware accelerator is not specifically limited. For example, the hardware accelerator can be a hardware multiplier, a hardware divider, a network card, a graphics processing unit (GPU), etc.
[0100] In this embodiment of the application, when it is determined that there are multiple candidate computing nodes among multiple computing nodes that are capable of executing subtasks, a candidate computing node with a hardware accelerator can also be determined from the multiple candidate computing nodes, and the candidate computing node with a hardware accelerator is determined as the target computing node for executing the subtask.
[0101] Understandably, in the embodiments of this application, when multiple candidate computing nodes are capable of executing subtasks, the subtasks are preferentially assigned to computing nodes with hardware accelerators, which can effectively reduce the processing burden of the CPU and ensure the efficient and stable execution of tasks.
[0102] In some embodiments, determining the target computing node for executing a subtask from multiple candidate computing nodes according to a task allocation strategy may include: determining the candidate computing node where the data source unit is located from multiple candidate computing nodes; and determining the candidate computing node where the data source unit is located as the target computing node for executing the subtask.
[0103] For example, as can be seen from the above, the computing network also includes data source units; the task allocation strategy may also include an allocation strategy related to the location of the data source unit; as can be seen from the above, the data source unit can be used to acquire or monitor data related to computing tasks.
[0104] In this embodiment of the application, when it is determined that there are multiple candidate computing nodes among multiple computing nodes that can execute subtasks, the candidate computing node where the data source unit is located can also be determined from the multiple candidate computing nodes, and the candidate computing node where the data source unit is located can be determined as the target computing node for executing the subtask.
[0105] Understandably, in the embodiments of this application, when multiple candidate computing nodes are capable of executing subtasks, the subtasks are preferentially assigned to the computing node where the data source unit is located, which can significantly reduce data transmission costs and improve task processing efficiency.
[0106] In this embodiment of the application, the content of the above-mentioned task allocation strategy is not specifically limited. For example, in addition to the above-mentioned allocation strategy related to node load, allocation strategy related to hardware accelerator, and allocation strategy related to data source unit location, the task allocation strategy may also include other allocation strategies related to data integrity, reliability, or real-time performance.
[0107] It should be noted that in the process of determining the target computing node according to any of the task allocation strategies, if the number of candidate computing nodes that meet the allocation strategy is multiple, other allocation strategies in the task allocation strategy can be used to comprehensively determine the target computing node with better performance. The corresponding process is similar to the determination process of any of the above allocation strategies, and will not be repeated here to avoid repetition.
[0108] S103. Execute the corresponding subtasks using the determined target computing node until all the split subtasks have been executed, and obtain the execution result of the computing task.
[0109] In this embodiment of the application, after determining the target computing node for executing the subtask according to the above steps, the corresponding subtask can be executed using the determined target computing node. The above steps are repeated until all the subtasks after splitting are executed. At this time, the execution result of the computing task can be obtained.
[0110] For example, the computing units of the target computing node can be used to execute the corresponding subtasks. As can be seen from the above, the subtasks after being split have a sequential execution order. That is, executing one computing task is equivalent to executing multiple subtasks in a sequential order. During the task execution process, if the previous subtask is successfully executed, the next subtask will continue to be executed. If the last subtask is successfully executed, then all subtasks are successfully executed, that is, the computing task is successfully executed. At this time, the execution result of the computing task can be obtained. It should be noted that the execution result of the computing task can be the execution result of the last subtask.
[0111] For example, suppose there are at least two subtasks, including subtask 1 and subtask 2. If the execution order of these two subtasks is subtask 2 and subtask 1, then during the task execution process, subtask 2 will be executed first, and then subtask 1 will be executed. In this case, the execution result of the task will be the execution result of subtask 1.
[0112] As can be seen, in this embodiment of the application, after obtaining the computing task to be executed, the computing task is split into sub-tasks and each sub-task is assigned to the corresponding target computing node for processing. This ensures that only necessary data is transmitted during the task processing, thus effectively reducing the amount of data transmitted and improving the efficiency of task processing. In addition, the above-mentioned distributed computing method can cope with various types of data sources and complex data processing needs, and has a certain degree of flexibility and adaptability.
[0113] To better illustrate the purpose of this application, based on the above embodiments, further illustrative examples are provided regarding the functions of each component in the computing network and the execution process of computing tasks.
[0114] For example, data source units in a computing network generate and distribute data related to computing tasks, and provide data acquisition and push capabilities for computing units to consume. The data source units register information such as the data they provide, interface information, and address information with the computing management device for comprehensive management.
[0115] For example, the computing units built into each computing node in the computing network support a preset set of operators. This preset set of operators provides general operators for performing corresponding data processing operations, such as data size comparison, mathematical transformation, and logical operations. User-defined operators can also be used on this basis for complex operations such as machine learning or deep learning, thereby expanding the computing capabilities of the computing nodes. Similarly, each computing unit registers its supported preset set of operators, address, and computing cost information with the computing management device for comprehensive management.
[0116] For example, the computing management device in the computing network can acquire data source unit information and computing unit information to maintain the overall topology of the computing network; computing tasks are parsed and executed by the computing management device. During execution, it is determined whether the task can be split based on the set of operators corresponding to the computing task. If the computing task can be split and there are computing nodes that support the execution of the split subtasks, the computing task is split into subtasks that can be executed independently on the computing nodes, and the subtasks are assigned to the corresponding target computing nodes according to the recorded computing network topology information. The data required during the execution of the subtasks is obtained by the computing management device by establishing a network connection based on the stored data source unit information and calling relevant interfaces. After splitting and assigning computing tasks, the computing management device waits for and summarizes the computing results for further calculations.
[0117] Below, with Figure 2 The computational network shown further illustrates the execution process of computational tasks, such as... Figure 2 As shown, the computing network includes computing nodes A, B, and C. The ComputeManager runs on computing node A. The ComputeSink_A unit in computing node A supports the following preset operators: greater than, less than, and equal to. Similarly, the ComputeSink_B unit in computing node B supports the same preset operators. The DataSource_B unit is deployed on computing node B and provides a data acquisition interface (get) and a data listening interface (sub). The ComputeSink_C unit in computing node C supports the following preset operators: sum, average, maximum, and minimum. This information is synchronized to the ComputeManager after a connection is established. Figure 2 Step 1 in the process.
[0118] For example, suppose the computational task is to continuously monitor the battery temperature. When the temperature exceeds 50 degrees Celsius, calculate the average temperature. If the average temperature still exceeds 50 degrees Celsius within 5 seconds, send an alarm message indicating that the battery temperature is too high. This computational task can be represented in code as follows:
[0119] on battery_temperature>50&&avg(battery_temperature,5)>50
[0120] The system emits a message indicating that the battery temperature is too high.
[0121] For example, after the above computing task is loaded by the computing management device (ComputeManager), it is parsed and split by the computing management device. First, the subtask battery_temperature>50 is split into subtasks. Since both computing units ComputeSink_A and ComputeSink_B support the operator ">" in this subtask, both computing units ComputeSink_A and ComputeSink_B can execute this subtask. However, since computing unit ComputeSink_B and data source unit DataSource_B are on the same computing node B, the data transmission cost is lower. Therefore, the split subtask battery_temperature>50 can be preferentially sent to computing unit ComputeSink_B in computing node B for execution. Figure 2 Step 2 in the process.
[0122] Furthermore, the computing unit ComputeSink_B continuously monitors the battery temperature data (battery_temperature) generated in the data source unit DataSource_B through a listening interface (sub) and makes a judgment. If it is determined that the condition is not met, subsequent tasks do not need to be executed; correspondingly Figure 2 Step 3 in the process.
[0123] For example, if it is determined that the condition battery_temperature > 50 is met, the subtask avg(battery_temperature, 5) after further splitting is processed. Since only the computing unit ComputeSink_C in computing node C currently supports the operator "avg" in this subtask, the subtask avg(battery_temperature, 5) can be sent to the computing unit ComputeSink_C in computing node C for execution. At this time, the computing unit ComputeSink_C continuously listens to the battery temperature data battery_temperature generated in the data source unit DataSource_B through the listening interface (sub), caches it for 5 seconds, and then calculates the average temperature; correspondingly Figure 2 Step 4 in the process.
[0124] For example, for the operator ">" in the subtasks obtained from subsequent splitting, although both ComputeSink_A and ComputeSink_B support it, their data transmission costs are not significantly different. In this case, it is preferable to execute it in ComputeSink_A of the computing node A where the computing management device (ComputeManager) resides, which facilitates subsequent processing. Therefore, the execution result of the subtask avg(battery_temperature, 5) can be fed back to the node computing node A, and its computing unit ComputeSink_A can be used to determine whether the subsequent subtask is >50 and to handle subsequent alarms. Figure 2 Step 5 in the process.
[0125] As can be seen, in this embodiment of the application, after obtaining the computing task to be executed, the computing task is split and intelligently assigned, which avoids the bottleneck of centralized processing, reduces unnecessary data transmission and processing time, and ensures that only necessary data is transmitted during task processing. In this way, the amount of data transmission can be effectively reduced and the task processing efficiency can be improved. In addition, the above-mentioned distributed computing method can cope with various types of data sources and complex data processing needs, and has a certain degree of flexibility and adaptability.
[0126] Based on the foregoing embodiments, this application also provides a task execution device, applied to a computing management device in a computing network, wherein the computing network further includes multiple computing nodes. Figure 3 This is a schematic diagram of the structure of the task execution device provided in the embodiments of this application, such as... Figure 3 As shown, the task execution device 3 may include:
[0127] The acquisition module 301 is used to acquire the computational tasks to be executed;
[0128] The determination module 302 is used to split the computing task when it is determined that the computing task needs to be split, and after obtaining each split subtask, determine the target operator corresponding to the subtask, and determine the target computing node for executing the subtask from multiple computing nodes based on the target operator.
[0129] The execution module 303 is used to execute the corresponding subtasks using the determined target computing node until all the split subtasks have been executed and the execution result of the computing task is obtained.
[0130] In some embodiments, the determining module 302 is further configured to:
[0131] Based on the target operator, determine whether there are multiple candidate computing nodes among multiple computing nodes that can execute the subtask;
[0132] If multiple candidate computing nodes capable of executing subtasks are identified, the target computing node for executing the subtasks is determined from among the multiple candidate computing nodes according to the task allocation strategy.
[0133] In some embodiments, the determining module 302 is further configured to:
[0134] Obtain the current load information of multiple candidate computing nodes;
[0135] Based on the current load information of multiple candidate computing nodes, determine the candidate computing node with the lowest current load from among the multiple candidate computing nodes;
[0136] The candidate computing node with the lowest current load is selected as the target computing node for executing the subtask.
[0137] In some embodiments, the determining module 302 is further configured to:
[0138] Candidate computing nodes with hardware accelerators are identified from multiple candidate computing nodes;
[0139] Candidate computing nodes with hardware accelerators are identified as target computing nodes for executing subtasks.
[0140] In some embodiments, the computing network further includes a data source unit; the determining module 302 is further configured to:
[0141] The candidate computing node containing the data source unit is determined from multiple candidate computing nodes; the data source unit is used to acquire data related to the computing task.
[0142] The candidate computing node where the data source unit is located is determined as the target computing node for executing the subtask.
[0143] In some embodiments, after obtaining the computational task to be executed, the determining module 302 is further configured to:
[0144] The computation task is parsed to obtain the set of operators corresponding to the computation task;
[0145] Based on the set of operators corresponding to the computation task, determine whether the computation task needs to be split.
[0146] In some embodiments, the determining module 302 is further configured to:
[0147] The multiple operators corresponding to the computation task are matched with the preset operator sets corresponding to each computation node to obtain the matching results;
[0148] Based on the matching results, determine whether the computation task needs to be split.
[0149] In practical applications, the acquisition module 301, determination module 302, and execution module 303 can all be implemented by a processor located in the task execution device. The processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor.
[0150] Based on the foregoing embodiments, this application also provides a task execution device. Figure 4 This is a schematic diagram of the structure of the task execution device provided in the embodiments of this application, such as... Figure 4 As shown, the task execution device 4 may include a processor 401 and a memory 402; wherein,
[0151] Memory 402 is used to store computer-executable instructions;
[0152] The processor 401, when executing computer-executable instructions or computer programs stored in the memory 402, implements a task execution method as described above.
[0153] Based on the foregoing embodiments, this application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the task execution method as described in any of the preceding embodiments.
[0154] Based on the foregoing embodiments, this application also provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, can implement the task execution method as described in any of the preceding embodiments.
[0155] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it may be a device that includes one or any combination of the above-mentioned memories.
[0156] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0157] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
Claims
1. A task execution method, characterized in that, A computing management device applied in a computing network, wherein the computing network further includes: multiple computing nodes, and the method includes: Obtain the computational tasks to be executed; If it is determined that the computing task needs to be split, the computing task is split, and after each split subtask is obtained, the target operator corresponding to the subtask is determined, and the target computing node for executing the subtask is determined from the plurality of computing nodes according to the target operator. The corresponding subtasks are executed using the determined target computing node until all the split subtasks have been executed, and the execution result of the computing task is obtained.
2. The method according to claim 1, characterized in that, The step of determining the target computing node for executing the subtask from the plurality of computing nodes based on the target operator includes: Based on the target operator, determine whether there are multiple candidate computing nodes among the plurality of computing nodes capable of executing the subtask; If it is determined that there are multiple candidate computing nodes capable of executing the subtask, a target computing node for executing the subtask is determined from the multiple candidate computing nodes according to the task allocation strategy.
3. The method according to claim 2, characterized in that, The step of determining the target computing node for executing the subtask from the plurality of candidate computing nodes according to the task allocation strategy includes: Obtain the current load information of the multiple candidate computing nodes; Based on the current load information of the multiple candidate computing nodes, determine the candidate computing node with the lowest current load from among the multiple candidate computing nodes; The candidate computing node with the lowest current load is determined as the target computing node for executing the subtask.
4. The method according to claim 2, characterized in that, The step of determining the target computing node for executing the subtask from the plurality of candidate computing nodes according to the task allocation strategy includes: Candidate computing nodes with hardware accelerators are determined from the plurality of candidate computing nodes; The candidate computing node with the hardware accelerator is determined as the target computing node for executing the subtask.
5. The method according to claim 2, characterized in that, The computing network also includes data source units; The step of determining the target computing node for executing the subtask from the plurality of candidate computing nodes according to the task allocation strategy includes: The candidate computing node where the data source unit is located is determined from the plurality of candidate computing nodes; the data source unit is used to acquire data related to the computing task; The candidate computing node where the data source unit is located is determined as the target computing node for executing the subtask.
6. The method according to any one of claims 1 to 5, characterized in that, After obtaining the computational task to be executed, the method further includes: The computation task is parsed to obtain the set of operators corresponding to the computation task; Based on the set of operators corresponding to the computation task, determine whether the computation task needs to be split.
7. The method according to claim 6, characterized in that, The set of operators includes multiple operators. The step of determining whether the computation task needs to be split based on the set of operators corresponding to the computation task includes: The multiple operators corresponding to the computing task are matched with the preset operator sets corresponding to each computing node to obtain the matching results; Based on the matching results, determine whether the computation task needs to be split.
8. A task execution device, characterized in that, A computing management device used in a computing network, wherein the computing network further includes multiple computing nodes, and the task execution device includes: The acquisition module is used to acquire computational tasks to be executed. The determination module is used to split the computing task when it is determined that the computing task needs to be split, and after obtaining each split subtask, determine the target operator corresponding to the subtask, and determine the target computing node for executing the subtask from the plurality of computing nodes according to the target operator; The execution module is used to execute the corresponding subtasks using the determined target computing node until all the split subtasks have been executed and the execution result of the computing task is obtained.
9. A task execution device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the task execution method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the task execution method as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the task execution method according to any one of claims 1 to 7.