Task node execution method and device, equipment, storage medium and program product
By determining and processing the execution marks of multiple task nodes in the task node execution method, the problem of inefficient execution of multitask nodes is solved, and more efficient and flexible task execution is achieved.
Patent Information
- Application Number
- CN202311214383.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, the execution efficiency of multiple task nodes is low, resulting in excessive waiting and delay in the process of executing task nodes.
A method of execution of a task node is provided. By obtaining multiple task nodes that currently need to be executed, the target task nodes with execution marks and their number are determined. If the number is greater than the preset threshold, the target task node is executed based on the execution marks (priority information and/or dependency information).
The efficiency of multi-task node execution is improved, unnecessary waiting and delay is avoided, and the number of target task nodes is flexibly judged whether task nodes need to be executed based on priority information and/or dependency information, thereby improving the efficiency and flexibility of execution.
Smart Images

Figure CN119668787A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of task node execution, and in particular to a task node execution method, device, equipment, storage medium and program product. Background Art
[0002] At present, in the context of large-scale and complex business, the frequency of multi-task node execution is increasing. However, in related technologies, the execution efficiency of multiple task nodes is low, resulting in excessive waiting and delays in the process of executing task nodes. Summary of the invention
[0003] In view of this, the purpose of the present application is to propose a method, device, electronic device, storage medium and program product for executing a task node, so as to improve the efficiency and flexibility of the execution of the task node.
[0004] Based on the above purpose, the present application provides a method for executing a task node, including:
[0005] Get multiple task nodes that need to be executed currently;
[0006] Determine that there are target task nodes with execution marks among the multiple task nodes, and determine the number of the target task nodes: wherein the execution marks include priority information and / or dependency information;
[0007] In response to the number of the target task nodes being greater than a preset threshold, the target task nodes are executed based on the execution tags.
[0008] Based on the same inventive concept, the exemplary embodiment of the present application further provides an execution device of a task node, including:
[0009] Get module to get multiple task nodes that need to be executed currently;
[0010] A determination module is configured to determine whether there is a target task node with an execution mark among the plurality of task nodes, and to determine the number of the target task nodes: wherein the execution mark includes priority information and / or dependency information;
[0011] The execution module executes the target task nodes based on the execution mark in response to the number of the target task nodes being greater than a preset threshold.
[0012] Based on the same inventive concept, an exemplary embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein when the processor executes the program, the execution method of the task node as described above is implemented.
[0013] Based on the same inventive concept, the exemplary embodiment of the present application also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the execution method of the task node as described above.
[0014] Based on the same inventive concept, the exemplary embodiment of the present application further provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the execution method of the task node as described above.
[0015] From the above, it can be seen that the task node execution method, device, and electronic device provided by the present application first obtain multiple task nodes that need to be executed currently, and then determine the target task nodes with execution marks among the multiple task nodes, and determine the number of the target task nodes: wherein the execution mark includes priority information and / or dependency information; when it is determined that the number of the target task nodes is greater than a preset threshold, the target task nodes are executed based on the execution mark, thereby further improving the efficiency of the execution of multiple task nodes, avoiding unnecessary waiting and delays in the execution of tasks, and at the same time, it can flexibly judge whether it is necessary to execute the task nodes according to the priority information and / or dependency information based on the number of target task nodes, further improving the efficiency and flexibility of execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 A schematic diagram of an application scenario of an embodiment of the present application;
[0018] Figure 2 A flowchart of a method for executing a task node according to an embodiment of the present application;
[0019] Figure 3 A flowchart of another method for executing a task node according to an embodiment of the present application;
[0020] Figure 4 A flowchart of another method for executing a task node according to an embodiment of the present application;
[0021] Figure 5 A schematic diagram of the structure of an execution device of a task node in an embodiment of the present application;
[0022] Figure 6 A schematic diagram of the structure of a specific electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of this specification more clear, this specification is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0024] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the categories, scope of use, usage scenarios, etc. of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0025] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0026] In order to make the purpose, technical solutions and advantages of this specification more clear, this specification is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0027] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements, objects or method steps appearing before the word cover the elements, objects or method steps listed after the word and their equivalents, without excluding other elements, objects or method steps. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly. In addition, in the description of the embodiments of the present application, unless otherwise specified, the term "multiple" refers to two or more. The term "and / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0028] It is understandable that before using the technical solutions of each embodiment of the present application, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0029] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to the electronic device, application, server, storage medium or other software or hardware that performs the operation of the technical solution of the present application according to the prompt message.
[0030] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0031] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation method of this application. Other methods that meet relevant laws and regulations may also be applied to the implementation method of this application.
[0032] As described in the background technology section, the execution efficiency of multiple task nodes in the current related art is low, resulting in excessive waiting and delay in the process of executing task nodes. For example, when there is a priority or dependency relationship between multiple execution task nodes, it is necessary to execute the task node with a higher priority or being dependent first. If all task nodes are executed directly in parallel through multiple threads, some task nodes will undoubtedly be unable to be executed directly, resulting in a large number of threads being wasted and the execution efficiency is not high. If all task nodes are executed serially directly through a thread, it is necessary to change the order of each task node through continuous attempts, which also results in low execution efficiency.
[0033] In order to solve the above technical problems, the present application provides a method for executing a task node, which first obtains multiple task nodes that need to be executed currently, then determines the target task nodes with execution marks among the multiple task nodes, and determines the number of the target task nodes: wherein the execution mark includes priority information and / or dependency information; when it is determined that the number of the target task nodes is greater than a preset threshold, the target task nodes are executed based on the execution mark, thereby further improving the efficiency of the execution of multiple task nodes and avoiding unnecessary waiting and delays in the execution of tasks. At the same time, it can be flexibly judged whether it is necessary to execute the task nodes according to the priority information and / or dependency information based on the number of target task nodes, thereby further improving the efficiency and flexibility of execution.
[0034] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application are described in detail below.
[0035] In some specific application scenarios, the execution method of the task node of the present application can be applied to various execution platforms or systems involving task nodes. For example, the execution platform of the task node can be a program development platform, or a service operation platform. As an example, the application scenario includes at least one server and at least one terminal. The server and the terminal can communicate through a network to achieve data transmission. Among them, the network can be a wired network or a wireless network, and the present application does not specifically limit this.
[0036] The server can be a server that provides various services. Specifically, the server can be used to provide background services for applications running on the terminal. Optionally, in some implementations, the execution method of the task node provided in the embodiment of the present application can be executed by a server or a terminal. The server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. The embodiment of the present application does not specifically limit this.
[0037] refer to Figure 1 , which is a schematic diagram of an application scenario of the execution method of the task node provided by the exemplary embodiment of the present application. The application scenario includes a terminal device 101, a server 102, and a data storage system 103. Among them, the terminal device 101, the server 102 and the data storage system 103 can be connected through a wired or wireless communication network. The terminal device 101 includes but is not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of realizing the above functions. The server 102 and the data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0038] The server 102 is used to provide the execution service of the task node to the user of the terminal device 101. The terminal device 101 is installed with a client that communicates with the server 102, and the user can obtain data through the client. During the execution of the task node, the server 102 can first obtain multiple task nodes that need to be executed, and then determine the target task nodes with execution marks among the multiple task nodes, and determine the number of the target task nodes. When it is determined that the number of the target task nodes is greater than a preset threshold, the target task nodes are executed based on the execution mark. Optionally, the execution process of the task node can also be completed by the client, which is not limited to this.
[0039] The data storage system 103 stores various data related to data query. Both the terminal device 101 and the server 102 can randomly retrieve various data from the data storage system 103 .
[0040] Combine the following Figure 1 The execution method of the task node according to the exemplary embodiment of the present application is described by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present application, and the implementation of the present application is not limited in this respect. On the contrary, the implementation of the present application can be applied to any applicable scenario.
[0041] refer to Figure 2 The present application provides a method for executing a task node, the method comprising the following steps:
[0042] S101, obtaining multiple task nodes that currently need to be executed.
[0043] In specific implementation, when executing multiple task nodes, first obtain the multiple task nodes that need to be executed currently. Each task node corresponds to a task. The specific tasks can be set as needed and there is no limitation on this. For example, the task corresponding to the task node can be a service in the development process of an application.
[0044] S102, determining whether there are target task nodes with execution marks among the multiple task nodes, and determining the number of the target task nodes: wherein the execution marks include priority information and / or dependency information.
[0045] During specific implementation, after obtaining multiple task nodes that need to be executed currently, it is possible to further determine the target task nodes with execution marks among the multiple task nodes. Optionally, the multiple task nodes can be divided into target task nodes with execution marks and ordinary task nodes without any execution marks. Ordinary task nodes can be directly executed because they do not have any association with any other nodes, while target task nodes with marks often need to further consider the association with other task nodes when executing. For example, when target task node A wants to execute, it must first obtain the execution result of target task node B, that is, it is necessary to execute target task node B before executing target task node A. At this time, there is a dependency relationship between target task node A and target task node B. Alternatively, in some embodiments, the priority of each target task node is specified in advance, and the task node with a higher priority needs to be executed first.
[0046] Considering that for the execution process of multiple task nodes, if the number of task nodes with execution marks is small, the impact on the execution of multiple task nodes is small. At this time, this impact can be ignored, and the execution of multiple task nodes can be directly performed in the default way, which may be more efficient, and the calculation process of executing the strategy through each execution mark can be omitted. However, when the number of task nodes with execution marks is small, it is necessary to first calculate the execution strategy through each execution mark to further optimize the task execution process, thereby reducing the impact between various related task nodes and further improving the efficiency of task node execution.
[0047] It should be noted that the execution mark includes priority information and / or dependency information, that is, the execution mark can include priority information alone, or dependency information alone, or both priority information and dependency information. Optionally, both priority information and dependency information can be set and marked in advance according to user requirements or the dependency relationship between each task node.
[0048] S103: In response to the number of the target task nodes being greater than a preset threshold, executing the target task nodes based on the execution tags.
[0049] In specific implementation, when it is determined that the number of target task nodes is greater than a preset threshold, in order to further improve the task execution efficiency, the target task nodes can be executed according to the execution mark, that is, the execution strategy of the target task nodes can be determined by priority information and / or dependency information.
[0050] In some embodiments, after determining the number of target task nodes, the method further includes:
[0051] In response to the number of the target task nodes being no greater than a preset threshold, the multiple task nodes are executed in parallel by multiple threads; wherein each thread executes one task node individually.
[0052] In specific implementation, when it is determined that the number of the target task nodes is not greater than the preset threshold, since the influence of the target task nodes can be ignored, the multiple task nodes can be directly executed in parallel through multiple threads; wherein each thread executes a task node separately. That is, the resources of the hardware system can be fully utilized to try to execute all task nodes as much as possible so that they can be executed simultaneously.
[0053] In some embodiments, executing the target task node based on the execution mark specifically includes:
[0054] Obtain the execution tag; wherein the execution tag includes dependency information; group the target task nodes based on the dependency information to obtain multiple groups of target task node sets; wherein there is a dependency between the task nodes in each group of the target task node sets, and there is no dependency between the groups of the target task node sets; execute the multiple groups of target task node sets in parallel through multiple threads; wherein each thread executes a group of target task node sets separately.
[0055] In specific implementation, in some embodiments, the execution tag only includes dependency information. In this case, the target task nodes can be grouped based on the dependency information to obtain multiple sets of target task nodes, and then the multiple sets of target task nodes are executed in parallel through multiple threads; wherein each thread executes a set of target task nodes separately. That is, the target task nodes with dependencies are placed in the same thread for execution in sequence, while those target task nodes without dependencies are placed in different threads for execution, thereby ensuring that unrelated task nodes can be executed at the same time to the greatest extent, and there is no waste of resources caused by the inability of some task nodes in some threads to be executed immediately due to dependencies.
[0056] In some embodiments, executing the multiple sets of target task node sets in parallel through multiple threads specifically includes:
[0057] For each set of target task nodes, a step-by-step sorting is performed based on dependency information corresponding to each of the target task nodes; and each of the target task nodes is executed in sequence based on the step-by-step sorting.
[0058] In specific implementation, after the target task nodes are grouped, for each set of target task nodes, a step sorting is first performed according to the dependency information corresponding to each target task node. Optionally, the dependent target task nodes are sorted first, and the target task nodes sorted later depend on the target task nodes in front. After the step sorting is performed, each target task node is executed in sequence according to the step sorting. Figure 3 ,in, Figure 3 The target task nodes in the figure are divided into two groups. The first group is executed in the order of ECFBA, and the second group is executed in the order from G to D. It can be seen that the two groups of target task nodes can be executed in parallel, and each group of target task nodes is executed in sequence according to the dependency relationship.
[0059] In some embodiments, executing each of the target task nodes in sequence based on the topology order specifically includes:
[0060] Based on the topology sorting, determine the first task node that needs to be executed currently, and the second task node sorted after the first task node; based on the dependency information corresponding to the second task node, determine whether the second task node has a dependency relationship with the first task node; in response to the second task node not having a dependency relationship with the first task node, start a new thread, and execute the second task node through the new thread.
[0061] In the specific implementation, it is considered that even in the same set of target task nodes, not every two adjacent target task nodes have a dependency relationship. For example, a set of target task nodes includes three target task nodes M, N, and X, among which N and X both depend on M, but there is no dependency relationship between N and X. At this time, when topological sorting is performed, they may be arranged in the order of M, N, and X. In this way, when the N task starts to be executed, since the M task has been completed, the X task can also be executed directly at this time. Therefore, in order to improve efficiency, a new thread can be started to execute task X, so that tasks N and X can be saved and executed at the same time, further improving the execution efficiency of the task nodes.
[0062] In some embodiments, executing the target task node based on the execution mark specifically includes:
[0063] Obtain the execution tag; wherein the execution tag includes priority information; determine the priority of the target task node based on the priority information, and determine the execution order of each target task node based on the priority of the target task node; and execute each task node in the target thread in sequence based on the execution order of each target task node.
[0064] In specific implementation, in some embodiments, the execution tag only includes priority information. In this case, in order to ensure the execution sequence of each target task node, the execution sequence of each target task node can be determined based on the priority of the target task node; then, each task node is executed in sequence in the target thread based on the execution sequence of each target task node. It should be noted that the target thread is the thread currently executing the task node and has no special meaning.
[0065] In some embodiments, executing each task node in the target thread in sequence based on the execution order of each target task node specifically includes:
[0066] Based on the topology sorting, the first priority task node that needs to be executed currently is determined; the execution tag also includes dependency information; based on the dependency information, it is determined whether there is a target dependent task node in the first priority task section; in response to determining that there is a target dependent task node in the first priority task section, a branch thread is opened for the target dependent task node, and the target dependent task node is executed based on the branch thread.
[0067] In the specific implementation, when the execution mark includes both dependency information and priority information, while ensuring that each target task node can be executed in the order of priority as much as possible, it is also necessary to further consider the dependency relationship of each target task node, that is, when executing a target task node with a higher priority, it is necessary to further determine whether there is a target dependent task node of the target task node. If so, the target dependent task node needs to be executed first. In order to improve the execution efficiency, a new sub-thread can be opened separately for the target dependent task node to execute the target dependent task node. Figure 4 , Figure 4 In the example, the priority of each target task node is arranged in the order of GFCBADE. However, in the actual execution process, new sub-threads will be opened separately for the D and E task nodes because the target dependent task nodes must be taken into account.
[0068] In some embodiments, executing the target dependent task node based on the branch thread specifically includes:
[0069] Determine the number of the target dependent task nodes; in response to the number of the target dependent task nodes being multiple, start the branch threads corresponding to the number of the multiple target dependent task nodes, and execute the target dependent task nodes in parallel through the branch threads; wherein each branch thread executes a target dependent task node separately.
[0070] In specific implementation, when the number of the target-dependent task nodes is multiple, that is, in order to execute the current first-priority task node, multiple target-dependent task nodes need to be executed first, multiple sub-linear threads can be opened at the same time, and then each branch thread executes a target-dependent task node separately.
[0071] In some embodiments, executing the target dependent task node based on the branch thread specifically includes:
[0072] Determine the number of target dependent task nodes;
[0073] In response to the number of the target dependent task nodes being multiple, the multiple target dependent task nodes are grouped based on the dependency information to obtain multiple groups or one set of target dependent task node sets;
[0074] In response to the plurality of target dependent task nodes being divided into a plurality of target dependent task node sets, a plurality of branch threads are started, and the plurality of dependent task node sets are executed in parallel by the plurality of branch threads; wherein each branch thread executes a set of dependent task node sets separately;
[0075] In response to the plurality of target-dependent task nodes being divided into a set of target-dependent task nodes, a branch thread is started, and each of the target-dependent task nodes is sequentially executed in the branch thread based on the dependency information.
[0076] In specific implementation, when there are multiple target-dependent task nodes, it is further considered that there may be dependencies between the multiple target-dependent task nodes. When there are dependencies between the multiple target-dependent task nodes, even if a sub-thread is opened separately for each target-dependent task node, some target-dependent task nodes that need to rely on other task nodes still cannot be directly executed, but will result in the opening of redundant sub-threads in vain. At this time, the multiple target-dependent task nodes can be grouped based on the dependency information. When the multiple target-dependent task nodes are divided into multiple groups of target-dependent task node sets, multiple branch threads can be opened, and the multiple groups of dependent task node sets can be executed in parallel through the multiple branch threads; when the multiple target-dependent task nodes are divided into one group of target-dependent task node sets, only one branch thread needs to be opened, and each target-dependent task node is executed in sequence in the branch thread based on the dependency information.
[0077] In some embodiments, when a thread has executed all task nodes, the thread may be terminated, that is, the registers and stacks occupied by the thread may be released.
[0078] The task node execution method, device, electronic device, storage medium and program product provided by the present application first obtain multiple task nodes that need to be executed currently, then determine the target task nodes with execution marks among the multiple task nodes, and determine the number of the target task nodes: wherein the execution mark includes priority information and / or dependency information; when it is determined that the number of the target task nodes is greater than a preset threshold, the target task nodes are executed based on the execution mark, thereby further improving the efficiency of multi-task node execution and avoiding unnecessary waiting and delays in task execution. At the same time, it can be flexibly judged whether it is necessary to execute the task nodes according to the priority information and / or dependency information according to the number of target task nodes, thereby further improving the efficiency and flexibility of execution.
[0079] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of the embodiment of the present application can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0080] It should be noted that the above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0081] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides an execution device for a task node.
[0082] refer to Figure 5 , the execution device of the task node comprises:
[0083] Acquisition module 201, acquiring multiple task nodes that currently need to be executed;
[0084] The determination module 202 determines whether there is a target task node with an execution mark among the plurality of task nodes, and determines the number of the target task nodes: wherein the execution mark includes priority information and / or dependency information;
[0085] The execution module 203 executes the target task nodes based on the execution mark in response to the number of the target task nodes being greater than a preset threshold.
[0086] In some embodiments, the apparatus further comprises a parallel execution module, configured to:
[0087] In response to the number of the target task nodes being no greater than a preset threshold, the multiple task nodes are executed in parallel by multiple threads; wherein each thread executes one task node individually.
[0088] In some embodiments, the execution module 203 is specifically used to:
[0089] Acquire the execution tag; wherein the execution tag includes dependency information;
[0090] The target task nodes are grouped based on the dependency information to obtain multiple groups of target task node sets; wherein there is a dependency relationship between the task nodes in each group of the target task node sets, and there is no dependency relationship between the target task node sets of each group;
[0091] The multiple groups of target task node sets are executed in parallel by multiple threads; wherein each thread executes a group of target task node sets separately.
[0092] In some embodiments, the execution module 203 is specifically used to:
[0093] For each set of target task nodes, a step-by-step sorting is performed based on dependency information corresponding to each of the target task nodes; and each of the target task nodes is executed in sequence based on the step-by-step sorting.
[0094] In some embodiments, the execution module 203 is specifically used to:
[0095] Determine a first task node that needs to be executed currently and a second task node that is ordered after the first task node based on the topology step order;
[0096] Determine whether the second task node has a dependency relationship with the first task node based on the dependency relationship information corresponding to the second task node;
[0097] In response to the fact that the second task node has no dependency relationship with the first task node, a new thread is started, and the second task node is executed through the new thread.
[0098] In some embodiments, the execution module 203 is specifically used to:
[0099] Acquire the execution mark; wherein the execution mark includes priority information;
[0100] Determine the priority of the target task node based on the priority information, and determine the execution order of each of the target task nodes based on the priority of the target task node;
[0101] Execute each task node in sequence in the target thread based on the execution order of each target task node.
[0102] In some embodiments, the execution module 203 is specifically used to:
[0103] Determine the first priority task node that needs to be executed currently based on the topology order; the execution mark also includes dependency information;
[0104] Determine whether the first priority task node has a target dependent task node based on the dependency information;
[0105] In response to determining that a target-dependent task node exists in the first priority task node, a branch thread is started for the target-dependent task node, and the target-dependent task node is executed based on the branch thread.
[0106] In some embodiments, the execution module 203 is specifically used to:
[0107] Determine the number of target dependent task nodes;
[0108] In response to the number of the target dependent task nodes being multiple, the branch threads corresponding to the number of the target dependent task nodes are started, and the target dependent task nodes are executed in parallel through the branch threads; wherein each branch thread executes one target dependent task node separately.
[0109] In some embodiments, the execution module 203 is specifically used to:
[0110] Determine the number of task nodes on which the target depends;
[0111] In response to the number of the target dependent task nodes being multiple, the multiple target dependent task nodes are grouped based on the dependency information to obtain multiple groups or one set of target dependent task node sets;
[0112] In response to the plurality of target dependent task nodes being divided into a plurality of target dependent task node sets, a plurality of branch threads are started, and the plurality of dependent task node sets are executed in parallel by the plurality of branch threads; wherein each branch thread executes a set of dependent task node sets separately;
[0113] In response to the plurality of target-dependent task nodes being divided into a set of target-dependent task nodes, a branch thread is started, and each of the target-dependent task nodes is sequentially executed in the branch thread based on the dependency information.
[0114] The execution device of the task node in the above embodiment is used to implement the execution method of the corresponding task node in any of the above embodiments, and has the beneficial effects of the corresponding data query method embodiment, which will not be repeated here.
[0115] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the execution method of the task node described in any of the above embodiments is implemented.
[0116] Figure 6 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0117] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0118] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0119] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0120] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0121] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0122] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0123] The electronic device of the above embodiment is used to implement the execution method of the corresponding task node in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0124] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the execution method of the task node as described in any of the above embodiments.
[0125] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0126] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the execution method of the task node as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0127] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure further provides a computer program product, which includes a computer program. In some embodiments, the computer program is executed by one or more processors so that the processors execute the execution method of the task node described in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0128] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; based on the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0129] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0130] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0131] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A method for executing a task node, characterized in that: include: Get multiple task nodes that need to be executed currently; Determine that there are target task nodes with execution marks among the multiple task nodes, and determine the number of the target task nodes: wherein the execution marks include priority information and / or dependency information; In response to the number of the target task nodes being greater than a preset threshold, the target task nodes are executed based on the execution tags.
2. The method according to claim 1, characterized in that After determining the number of the target task nodes, the method further includes: In response to the number of the target task nodes being no greater than a preset threshold, the multiple task nodes are executed in parallel by multiple threads; wherein each thread executes one task node individually.
3. The method according to claim 1, characterized in that Executing the target task node based on the execution mark specifically includes: Acquire the execution tag; wherein the execution tag includes dependency information; The target task nodes are grouped based on the dependency information to obtain multiple groups of target task node sets; wherein there is a dependency relationship between the task nodes in each group of the target task node sets, and there is no dependency relationship between the target task node sets of each group; The multiple groups of target task node sets are executed in parallel by multiple threads; wherein each thread executes a group of target task node sets separately.
4. The method according to claim 3, characterized in that Executing the multiple sets of target task nodes in parallel through multiple threads specifically includes: For each set of target task nodes, a step-by-step sorting is performed based on dependency information corresponding to each of the target task nodes; and each of the target task nodes is executed in sequence based on the step-by-step sorting.
5. The method according to claim 3, characterized in that: Executing each of the target task nodes in sequence based on the step order specifically includes: Determine a first task node that needs to be executed currently and a second task node that is ordered after the first task node based on the topology step order; Determine whether the second task node has a dependency relationship with the first task node based on the dependency relationship information corresponding to the second task node; In response to the fact that the second task node has no dependency relationship with the first task node, a new thread is started, and the second task node is executed through the new thread.
6. The method according to claim 1, characterized in that Executing the target task node based on the execution mark specifically includes: Acquire the execution mark; wherein the execution mark includes priority information; Determine the priority of the target task node based on the priority information, and determine the execution order of each of the target task nodes based on the priority of the target task node; Execute each task node in sequence in the target thread based on the execution order of each target task node.
7. The method according to claim 6, characterized in that Executing each task node in the target thread in sequence based on the execution order of each target task node specifically includes: Determine the first priority task node that needs to be executed currently based on the topology order; the execution mark also includes dependency information; Determine whether the first priority task node has a target dependent task node based on the dependency information; In response to determining that a target-dependent task node exists in the first priority task node, a branch thread is started for the target-dependent task node, and the target-dependent task node is executed based on the branch thread.
8. The method according to claim 7, characterized in that Executing the target dependent task node based on the branch thread specifically includes: Determine the number of target dependent task nodes; In response to the number of the target dependent task nodes being multiple, the branch threads corresponding to the number of the target dependent task nodes are started, and the target dependent task nodes are executed in parallel through the branch threads; wherein each branch thread executes one target dependent task node separately.
9. The method according to claim 7, characterized in that: Executing the target dependent task node based on the branch thread specifically includes: Determine the number of target dependent task nodes; In response to the number of the target dependent task nodes being multiple, the multiple target dependent task nodes are grouped based on the dependency information to obtain multiple groups or one set of target dependent task node sets; In response to the plurality of target dependent task nodes being divided into a plurality of target dependent task node sets, a plurality of branch threads are started, and the plurality of dependent task node sets are executed in parallel by the plurality of branch threads; wherein each branch thread executes a set of dependent task node sets separately; In response to the plurality of target-dependent task nodes being divided into a set of target-dependent task nodes, a branch thread is started, and each of the target-dependent task nodes is sequentially executed in the branch thread based on the dependency information.
10. A task node execution device, characterized in that: include: Get module to get multiple task nodes that need to be executed currently; A determination module is configured to determine whether there is a target task node with an execution mark among the plurality of task nodes, and to determine the number of the target task nodes: wherein the execution mark includes priority information and / or dependency information; The execution module executes the target task nodes based on the execution mark in response to the number of the target task nodes being greater than a preset threshold.
11. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method according to any one of claims 1 to 9 when executing the program.
12. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 9.