Task node execution control method based on data task network
By generating virtual execution networks and semaphore management mechanisms, the problem of task dependence and dynamic changes in complex data task networks is solved, and task execution efficiency and flexibility are improved.
Patent Information
- Application Number
- CN202510286376.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When facing complex data task networks, the prior art is difficult to meet the dependencies between task nodes, and lacks support for dynamic changes in task parameters, resulting in inefficient task execution and waste of resources.
By generating a virtual execution network for the task, the dependencies between task nodes are clarified, and the semaphore of each task is determined based on the virtual execution network, a task list is generated to reasonably allocate execution priority, and finally the target task is determined from the task list based on the semaphore and executed.
It improves the accuracy and efficiency of task scheduling, optimizes the task execution order, reduces task waiting time, improves overall execution efficiency, and enhances the flexibility and adaptability of task execution.
Smart Images

Figure CN119806786A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing, and specifically relates to a task node execution control method, device and storage medium based on a data task network. Background Art
[0002] With the increase in data processing needs, the execution management of complex data tasks has become increasingly important. Especially in the field of large-scale data processing and data analysis, how to efficiently schedule and execute data tasks is a key issue. Traditional task execution methods often have problems of inefficiency and waste of resources, while the task node execution control method based on the data task network can effectively solve these problems and improve the execution efficiency of data tasks.
[0003] At present, the traditional task execution method usually adopts independent task units, each of which is executed independently and has no connection with each other.
[0004] However, although this method is simple to implement, it often cannot meet the dependencies between task nodes when faced with complex data task networks, lacks support for dynamic changes in task parameters, and is difficult to meet the needs of complex task scheduling in practical applications. Summary of the invention
[0005] The present application aims to provide a task node execution control method, device and storage medium based on a data task network, at least to solve the problem of low applicability to complex tasks when parameters are dynamic.
[0006] In a first aspect, an embodiment of the present application discloses a task node execution control method based on a data task network, comprising: According to a plurality of tasks to be executed, a virtual execution network of the tasks is generated; each virtual execution node in the virtual execution network corresponds to each of the tasks to be executed one by one; the connection relationship between the virtual execution nodes in the virtual execution network is used to characterize the execution dependency relationship between the tasks corresponding to each virtual execution node; According to the virtual execution network, determining the semaphore of each task, and generating a task list for recording the semaphore and task content of the task according to the virtual execution network; the semaphore of the task is negatively correlated with the execution priority of the task; According to the signal quantity of each task, a target task is determined from the task list, and the target task is executed; the target task is a task that meets the execution condition among the tasks.
[0007] In a second aspect, the embodiment of the present application further discloses a task node execution control device based on a data task network, comprising: A network generation module, used to generate a virtual execution network of the tasks according to a plurality of tasks to be executed; each virtual execution node in the virtual execution network corresponds to each of the tasks to be executed one by one; the connection relationship between the virtual execution nodes in the virtual execution network is used to characterize the execution dependency relationship between the tasks corresponding to each virtual execution node; An index generation module, used to determine the semaphore of each task according to the virtual execution network, and generate a task list for recording the semaphore and task content of the task according to the virtual execution network; the semaphore of the task is negatively correlated with the execution priority of the task; The task execution module is used to determine the target task from the task list according to the signal quantity of each task, and execute the target task; the target task is the task that meets the execution condition among the tasks.
[0008] In a third aspect, an embodiment of the present application further discloses an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In summary, in the embodiment of the present application, by generating a virtual execution network of the task, the dependency between each task node can be clarified, ensuring that the task is executed in the correct order, and improving the accuracy and efficiency of task scheduling; and then the semaphore of each task can be determined according to the virtual execution network, and a task list that records the task semaphore and task content can be generated, so that the priority of task execution can be reasonably allocated, thereby optimizing the execution order of tasks, reducing task waiting time, and improving overall execution efficiency; finally, according to the semaphore of each task, the target task is determined from the task list and the target task is executed, solving the problem of lack of support for dynamic changes in task parameters in the prior art, and using a dynamic adjustment mechanism to effectively avoid the insufficiency of the traditional predefined scheduling table that cannot cope with changes in task parameters, making task execution more flexible and adaptable. Thus, based on the method of the embodiment of the present application, by generating a virtual execution network, determining the semaphore and dynamically adjusting the task execution order, complex data tasks can be efficiently managed and executed, task execution efficiency can be improved, and resource waste can be reduced. The problem of low applicability to complex tasks in the case of dynamic parameters is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In the attached picture: Figure 1It is a flowchart of a task node execution control method based on a data task network provided by an embodiment of the present application; Figure 2 It is a flowchart of another method for executing a task node based on a data task network provided by an embodiment of the present application; Figure 3 It is a complete process of executing a task under the embodiment of the present application; Figure 4 It is a block diagram of a task node execution control device based on a data task network provided by an embodiment of the present application; Figure 5 is a block diagram of an electronic device according to an embodiment of the present application; Figure 6 It is a block diagram of an electronic device of another embodiment provided by the embodiments of the present application. DETAILED DESCRIPTION
[0012] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0013] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0014] like Figure 1 As shown, a task node execution control method based on a data task network is provided in an embodiment of the present application.
[0015] The method may include the following steps: Step 101: Generate a virtual execution network of tasks according to a plurality of tasks to be executed.
[0016] Among them, each virtual execution node in the virtual execution network corresponds to each task to be executed one by one; the connection relationship between each virtual execution node in the virtual execution network is used to characterize the execution dependency relationship between the tasks corresponding to each virtual execution node.
[0017] In some embodiments of the present application, in order to clarify the dependencies between task nodes, a virtual execution network of the task is generated. Among them, each virtual execution node in the virtual execution network corresponds to each task to be executed one by one; the connection relationship between each virtual execution node in the virtual execution network is used to characterize the execution dependency between the tasks corresponding to each virtual execution node. The virtual execution network is an abstract data structure used to represent multiple tasks and their mutual dependencies. After the virtual execution network of the task is generated, it can ensure that the tasks are executed in the correct order, improving the accuracy and efficiency of task scheduling.
[0018] In a specific example, a data analysis system needs to perform a series of data processing tasks, such as data cleaning, data aggregation, and data analysis. The system generates a virtual execution network of tasks, and each virtual execution node represents a data cleaning, data aggregation, and data analysis task. The node connection relationship in the virtual execution network represents that the data cleaning task must be completed before the data aggregation task, and the data aggregation task must be completed before the data analysis task. After generating the virtual execution network, the system can execute data processing tasks in the correct order, thereby improving the accuracy and overall efficiency of task execution.
[0019] Step 102: determine the semaphore of each task according to the virtual execution network, and generate a task list for recording the semaphore and task content of the task according to the virtual execution network.
[0020] Among them, the semaphore of a task is negatively correlated with the execution priority of the task.
[0021] In some embodiments of the present application, in order to reasonably allocate the execution priority of tasks, the semaphore of each task will be determined, and a task list for recording the semaphore of the task and the task content will be generated according to the virtual execution network. A semaphore refers to a sign indicating whether a task node has an execution condition. By generating a task list, the semaphores and task contents of all tasks to be executed can be systematically managed. After determining the semaphore of the task, the execution priority of the task is negatively correlated with the semaphore, that is, the smaller the semaphore, the higher the execution priority. In this way, the execution order of tasks can be optimized, the task waiting time can be reduced, and the overall execution efficiency can be improved.
[0022] In a specific example, a construction project management system needs to schedule multiple tasks, such as design, procurement, construction, and acceptance. The system determines the semaphore of each task based on the virtual execution network. The semaphore of the design task is 0, the semaphore of the procurement task is 1, the semaphore of the construction task is 2, and the semaphore of the acceptance task is 3. Subsequently, a task list is generated to record the semaphore and task content of each task. Since the design task has the smallest semaphore and has the highest execution priority, the system will prioritize the design task. This ensures that tasks are executed in a reasonable order, thereby improving the efficiency and accuracy of project management.
[0023] Step 103, determining a target task from the task list according to the semaphore of each task, and executing the target task.
[0024] Among them, the target task is the task that meets the execution conditions.
[0025] In some embodiments of the present application, in order to ensure that tasks are executed according to priority, a target task is determined from a task list according to the semaphore of each task, and the target task is executed. The target task refers to a task that meets the execution condition in the task, that is, a task whose semaphore has dropped to zero. After executing the target task, dynamic scheduling and efficient execution of tasks can be achieved to ensure the rational use of resources.
[0026] In a specific example, a software development project requires requirements analysis, design, coding, and testing in sequence. The system determines the target task from the task list based on the semaphore of each task and executes the target task. Since the semaphore of the requirements analysis task is the smallest, the system will prioritize the requirements analysis task. When the requirements analysis task is completed, its semaphore will be updated to zero, indicating that the execution conditions have been met. Subsequently, the system will determine the design task as the new target task and execute the design task. Through this dynamic scheduling mechanism, it can ensure that tasks are executed in priority order, improving the efficiency and accuracy of project management.
[0027] In summary, in the embodiment of the present application, by generating a virtual execution network of the task, the dependency between each task node can be clarified, ensuring that the task is executed in the correct order, and improving the accuracy and efficiency of task scheduling; and then the semaphore of each task can be determined according to the virtual execution network, and a task list that records the task semaphore and task content can be generated, so that the priority of task execution can be reasonably allocated, thereby optimizing the execution order of tasks, reducing task waiting time, and improving overall execution efficiency; finally, according to the semaphore of each task, the target task is determined from the task list and the target task is executed, solving the problem of lack of support for dynamic changes in task parameters in the prior art, and using a dynamic adjustment mechanism to effectively avoid the insufficiency of the traditional predefined scheduling table that cannot cope with changes in task parameters, making task execution more flexible and adaptable. Thus, based on the method of the embodiment of the present application, by generating a virtual execution network, determining the semaphore and dynamically adjusting the task execution order, complex data tasks can be efficiently managed and executed, task execution efficiency can be improved, and resource waste can be reduced. The problem of low applicability to complex tasks in the case of dynamic parameters is solved.
[0028] Figure 2 This is another task node execution control method based on a data task network provided in an embodiment of the present application.
[0029] The method may include the following steps: Step 201: Generate a virtual execution network of tasks according to a plurality of tasks to be executed.
[0030] Among them, each virtual execution node in the virtual execution network corresponds to each task to be executed one by one; the connection relationship between each virtual execution node in the virtual execution network is used to characterize the execution dependency relationship between the tasks corresponding to each virtual execution node.
[0031] The method shown in this step has been explained in step 101 and will not be repeated here.
[0032] Optionally, step 201 includes the following sub-steps: Sub-step 2011, input each task to be executed into the task format parsing engine to obtain the execution dependency relationship of each task.
[0033] In some embodiments of the present application, in order to obtain the execution dependency of each task, each task to be executed is input into the task format parsing engine to obtain the execution dependency of each task. The task format parsing engine is a tool for analyzing the task format and its dependency. By parsing the format and content of the task, the dependency between tasks can be determined. After parsing, the execution order and conditions of the tasks can be clarified, thereby improving the accuracy and efficiency of task scheduling.
[0034] In a specific example, a project management system needs to perform multiple tasks, such as requirements analysis, design, development, and testing. The system inputs each task to be executed into the task format parsing engine, which analyzes the format and content of each task and determines the execution dependencies between them. For example, the requirements analysis task must be completed before the design task can be carried out, and the development task can only be carried out after the design task is completed, and the testing task can only be carried out after the development task is completed. By parsing the execution dependencies of the tasks, the system can clarify the order of the tasks and improve the efficiency and accuracy of project management.
[0035] Sub-step 2012, generating a virtual execution network according to all execution dependencies.
[0036] In some embodiments of the present application, in order to systematically manage and execute complex tasks, a virtual execution network is generated based on all execution dependencies. A virtual execution network is an abstract data structure used to represent tasks and their interdependencies. By integrating the execution dependencies of all tasks, an overall virtual execution network is formed. After the virtual execution network is generated, the dependencies of all tasks can be clarified to ensure that the tasks are executed in the correct order and conditions, thereby improving the efficiency and accuracy of task scheduling.
[0037] In a specific example, a factory production management system needs to schedule multiple production tasks, such as raw material procurement, processing, assembly, and inspection. The system generates a virtual execution network based on the execution dependencies of all tasks. Each node in the virtual execution network represents the raw material procurement, processing, assembly, and inspection tasks, and the connection relationship between the nodes represents the execution dependency between these tasks. For example, the raw material procurement task must be completed before the processing task can be carried out, and the assembly task can only be carried out after the processing task is completed, and the inspection task can only be carried out after the assembly task is completed. By generating a virtual execution network, the system can systematically manage and schedule production tasks and improve production efficiency and accuracy.
[0038] Step 202: determine the semaphore of each task according to the virtual execution network, and generate a task list for recording the semaphore and task content of the task according to the virtual execution network.
[0039] Among them, the semaphore of a task is negatively correlated with the execution priority of the task.
[0040] The method shown in this step has been explained in step 102 and will not be repeated here.
[0041] Optionally, in order to determine the semaphore of each task according to the virtual execution network, step 202 includes the following sub-steps: Sub-step 2021, calculating the in-degree of each virtual execution node in the virtual execution network, and determining the in-degree of each virtual execution node as the semaphore of the task corresponding to each virtual execution node.
[0042] In some embodiments of the present application, in order to reasonably allocate the semaphore of tasks, the in-degree of each virtual execution node in the virtual execution network is calculated, and the in-degree of each virtual execution node is determined as the semaphore of the task corresponding to each virtual execution node. The in-degree refers to the number of predecessor task nodes that a node directly depends on. By calculating the in-degree of each node, the dependency relationship between task nodes and the order of task execution can be determined. After the in-degree is determined as a semaphore, the execution priority of the task can be reasonably allocated to improve the accuracy and efficiency of task scheduling.
[0043] In a specific example, a data processing system needs to schedule multiple data tasks, such as data cleaning, data conversion, and data analysis. The system calculates the in-degree of each virtual execution node in the virtual execution network. For example, the in-degree of the data cleaning task is 0, the in-degree of the data conversion task is 1, and the in-degree of the data analysis task is 2. Then, the in-degree of each virtual execution node is determined as the semaphore of the task corresponding to each virtual execution node. In this way, the semaphore of the data cleaning task is 0 and is executed first; the semaphore of the data conversion task is 1 and is executed second; the semaphore of the data analysis task is 2 and is executed last. In this way, the system can reasonably allocate the execution priority of tasks and improve the efficiency and accuracy of task scheduling.
[0044] Optionally, in order to generate a task list for recording task semaphores and task contents according to the virtual execution network, step 202 includes the following sub-steps: Sub-step 2022, determining a hash value of each task according to the virtual execution network.
[0045] In some embodiments of the present application, in order to effectively manage and find tasks, the hash value of each task is determined according to the virtual execution network. A hash value is a unique identifier generated by a hash algorithm, which is used to quickly index and find data. By calculating the hash value of each task, a unique identifier can be generated for each task, which facilitates the indexing and finding of tasks. After recording the hash value of each task in the task list, the task information can be effectively organized and managed, and the efficiency of task scheduling can be improved.
[0046] In a specific example, a data processing system needs to manage multiple data tasks, such as data cleaning, data conversion, and data analysis. The system determines the hash value of each data task based on the virtual execution network. For example, the hash value of the data cleaning task is 123456, the hash value of the data conversion task is 789012, and the hash value of the data analysis task is 345678. The system then records the hash value of each task in the task list. In this way, the system can quickly find and manage each task, improving the efficiency and accuracy of data processing.
[0047] Sub-step 2023, recording the hash value, task content, and semaphore of each task as an index of the task list to obtain the task list.
[0048] In some embodiments of the present application, an index for the task list is to systematically manage and search for tasks, and the hash value, task content, and semaphore of each task are recorded as an index of the task list to obtain the task list. The task content contains the specific information and execution details of each task, and the semaphore represents the execution condition of the task. By recording this information as an index of the task list, it is possible to effectively organize and manage task information, ensure the order and conditions of task execution, and improve the efficiency of task scheduling.
[0049] In a specific example, a data processing system needs to manage multiple data tasks, such as data cleaning, data conversion, and data analysis. The system records the hash value, task content, and semaphore of each task as an index in the task list. For example, the hash value of the data cleaning task is 123456, the task content includes the specific operation steps of data cleaning, and the semaphore is 0. The hash value of the data conversion task is 789012, the task content includes the specific operation steps of data conversion, and the semaphore is 1. The hash value of the data analysis task is 345678, the task content includes the specific operation steps of data analysis, and the semaphore is 2. In this way, the system can quickly find and manage each task, and reasonably schedule tasks according to the semaphore to improve the efficiency and accuracy of data processing.
[0050] Optionally, sub-step 2023 includes the following sub-steps: Sub-step 20231, recording the task name of each task, the name of the task template corresponding to each task, and the task parameters called by each task as task content in a preset format.
[0051] In some embodiments of the present application, in order to systematically manage task information, the task name of each task, the name of the task template corresponding to each task, and the task parameters called by each task are recorded as task content in a preset format. The task name is used to identify a specific task, the task template name represents the standardized structure of the task, and the task parameters are the specific information required to perform the task. By recording the task content in a preset format, the task information can be systematically organized and managed to ensure the accuracy and efficiency of task execution.
[0052] In a specific example, a data processing system needs to manage multiple data tasks, such as data cleaning, data conversion, and data analysis. The system records the task name of each task, the name of the task template corresponding to each task, and the task parameters called by each task as task content in a preset format. For example, the task name of the data cleaning task is "data cleaning", the task template name is "cleaning template", and the called task parameters include the input data path and cleaning rules. In this way, the system can systematically record and manage task information, ensure that each task is executed correctly, and improve the efficiency and accuracy of data processing.
[0053] Step 203, determining a target task from the task list according to the semaphore of each task, and executing the target task.
[0054] Among them, the target task is the task that meets the execution conditions.
[0055] The method shown in this step has been explained in step 103 and will not be repeated here.
[0056] Optionally, step 203 includes the following sub-steps: Sub-step 2031 , determining the task whose semaphore value is zero in the task list as the target task, and adding the target task to the task queue.
[0057] In some embodiments of the present application, in order to ensure that tasks are scheduled according to execution conditions, the tasks in the task list where the semaphore is zero value will be determined as target tasks, and the target tasks will be added to the task queue. The semaphore being zero value indicates that the task has the execution conditions and can be executed immediately. By adding these tasks to the task queue, tasks can be managed and scheduled in real time, ensuring that tasks are carried out in order according to priority and execution conditions, and improving the scheduling efficiency and execution accuracy of the system.
[0058] In a specific example, a data processing system needs to manage and schedule multiple data tasks. The system identifies the task with a semaphore of zero in the task list as the target task. For example, if the semaphore of a data cleaning task is zero, the system identifies it as the target task. Then, the system adds the target task to the task queue for execution. In this way, the system can dynamically manage and schedule data tasks, ensure that tasks are carried out in order according to execution conditions and priorities, and improve the efficiency and accuracy of data processing.
[0059] Sub-step 2032: sending the target task in the task queue to a task executor matching the target task to execute the target task.
[0060] In some embodiments of the present application, in order to ensure that the target task can be executed efficiently, the target task in the task queue is sent to a task executor that matches the target task to execute the target task. A task executor is a device or software module for performing a specific task. By sending the target task to an adapted task executor, it is possible to ensure that the task is correctly executed. The effect of this is to ensure that the task is accurately processed and improve the execution efficiency of the system.
[0061] In a specific example, an automated production system needs to perform multiple production tasks, such as processing, assembly, and quality inspection. The system sends the target tasks in the task queue, such as processing tasks, to the processing machines (task executors) that match the processing tasks. After receiving the tasks, the processing machines start to execute the processing tasks. In this way, the system can ensure that each task is correctly executed by the adapted task executors, thereby improving production efficiency and accuracy.
[0062] Optionally, sub-step 2032 includes the following sub-steps: Sub-step 20321, matches the execution condition of each target task in the task queue with the execution status of each task executor in the multiple task executors to determine the target task executor in the multiple task executors.
[0063] In some embodiments of the present application, in order to ensure that the task can be effectively executed, the execution condition of each target task in the task queue is matched with the execution state of each task executor in multiple task executors to determine the target task executor in multiple task executors. A task executor is a device or software module for executing a specific task. By matching the task execution condition and the state of the task executor, it can be ensured that the task is executed by the adapted executor, thereby optimizing resource utilization and task execution efficiency.
[0064] In a specific example, an automated production system needs to perform multiple production tasks, such as processing, assembly, and quality inspection. The system matches the target task in the task queue, such as the execution conditions of the processing task, with the execution status of multiple task executors (such as multiple processing machines). The system finds the processing machine (target task executor) that is currently idle and able to perform the processing task, and determines it as the executor of the processing task. Through this matching process, the system can ensure that each task is correctly executed by the adapted executor, improving production efficiency and accuracy.
[0065] Sub-step 20322, sending the mutually matching target tasks to the target task executor to execute the target tasks.
[0066] In some embodiments of the present application, in order to ensure that the target task can be correctly executed, the mutually matching target tasks are sent to the target task executor to execute the target task. The target task executor refers to a device or software module that can execute a specific target task. By sending the matching target task to the target task executor, it can be ensured that the task is effectively processed, thereby improving the execution efficiency and accuracy of the system.
[0067] In a specific example, a logistics management system needs to schedule multiple logistics tasks, such as sorting, packaging, and delivery. The system sends matching target tasks (such as sorting tasks) to sorting robots (target task executors) suitable for the task to perform the sorting tasks. After receiving the task, the sorting robot starts the sorting operation. In this way, the system can ensure that each task is properly handled by the appropriate executor, improving the efficiency and accuracy of logistics operations.
[0068] Step 204: updating the semaphore of the target task in the task list according to the execution of the target task.
[0069] In some embodiments of the present application, in order to ensure the correctness of the dynamic scheduling and execution order of tasks, the semaphores of other tasks in the task list will be updated according to the execution results after the target task is executed. The updating of the semaphore means that after the target task is executed, the semaphore of its subsequent dependent tasks is reduced until its semaphore becomes zero, indicating that the execution conditions are met. Through the updating of the semaphore, the execution status of the task can be reflected in real time, and it is ensured that the subsequent tasks are executed in the correct order, thereby improving the accuracy and efficiency of task execution.
[0070] In a specific example, there are tasks A, B, and C in the project management system. Task B depends on task A, and task C depends on task B. After executing task A, the system updates the semaphore of task B in the task list based on the execution result of task A, and reduces the semaphore of task B by 1. When the semaphore of task B drops to zero, it means that task B has the execution conditions. Subsequently, the system executes task B and updates the semaphore of task C in the task list based on the execution result of task B. In this way, the system can dynamically schedule and execute tasks, ensuring that each task is executed in the correct order and conditions, thereby improving the efficiency and accuracy of project management.
[0071] In summary, in the embodiment of the present application, by generating a virtual execution network of the task, the dependency between each task node can be clarified, ensuring that the task is executed in the correct order, and improving the accuracy and efficiency of task scheduling; and then the semaphore of each task can be determined according to the virtual execution network, and a task list that records the task semaphore and task content can be generated, so that the priority of task execution can be reasonably allocated, thereby optimizing the execution order of tasks, reducing task waiting time, and improving overall execution efficiency; finally, according to the semaphore of each task, the target task is determined from the task list and the target task is executed, solving the problem of lack of support for dynamic changes in task parameters in the prior art, and using a dynamic adjustment mechanism to effectively avoid the insufficiency of the traditional predefined scheduling table that cannot cope with changes in task parameters, making task execution more flexible and adaptable. Thus, based on the method of the embodiment of the present application, by generating a virtual execution network, determining the semaphore and dynamically adjusting the task execution order, complex data tasks can be efficiently managed and executed, task execution efficiency can be improved, and resource waste can be reduced. The problem of low applicability to complex tasks in the case of dynamic parameters is solved.
[0072] like Figure 3 As shown, it is a complete process of executing a task under the embodiment of the present application: S1. Task network parsing: The task network parser parses the task format and generates a task list; the task network parser is used to analyze task nodes and the relationship between them, and calculate the signal volume of each task node; Technical effect: The generated task network clarifies the execution order of tasks and improves the accuracy and efficiency of task scheduling.
[0073] S2. Task semaphore polling: The task semaphore polling module polls the task semaphore through the polling state machine; the polling state machine is a loop mechanism used to periodically check the status of the task semaphore; through polling, the task node with a semaphore of zero can be found in real time to ensure that the task node is scheduled according to the execution conditions.
[0074] S3, task enqueue: The task blocking queue receives tasks and queues them for execution; the task blocking queue is used to manage and store task nodes to be executed; it ensures that task nodes wait for execution in sequence, thereby improving the efficiency of task management and the orderliness of execution.
[0075] S4. Parallel task execution: The task execution parallel controller selects the appropriate executor to execute the task; the task execution parallel controller is used to manage the task nodes for parallel execution and allocate the corresponding executors; through parallel execution, the speed and efficiency of task processing are improved and the task execution time is reduced.
[0076] S5. Task semaphore modification: The task semaphore polling module modifies the task semaphore. The modified semaphore reflects the latest status of the task node; through the modification of the semaphore, the execution order of the task is dynamically adjusted to ensure that the task node is scheduled and executed according to the latest status.
[0077] refer to Figure 4 , which shows a task node execution control device 30 based on a data task network provided by an embodiment of the present application, comprising: The network generation module 301 is used to generate a virtual execution network of tasks according to a plurality of tasks to be executed; each virtual execution node in the virtual execution network corresponds to each task to be executed one by one; the connection relationship between each virtual execution node in the virtual execution network is used to characterize the execution dependency relationship between the tasks corresponding to each virtual execution node; The index generation module 302 is used to determine the semaphore of each task according to the virtual execution network, and generate a task list for recording the semaphore and task content of the task according to the virtual execution network; the semaphore of the task is negatively correlated with the execution priority of the task; The task execution module 303 is used to determine the target task from the task list according to the signal quantity of each task, and execute the target task; the target task is the task that meets the execution condition among the tasks.
[0078] Optionally, the network generation module 301 includes: The task parsing submodule is used to input each task to be executed into the task format parsing engine to obtain the execution dependency of each task; The network generation submodule is used to generate a virtual execution network based on all execution dependencies.
[0079] Optionally, the index generation module 302 includes: The semaphore calculation submodule is used to calculate the in-degree of each virtual execution node in the virtual execution network, and determine the in-degree of each virtual execution node as the semaphore of the task corresponding to each virtual execution node.
[0080] Optionally, the index generation module 302 includes: A hash calculation submodule, used to determine the hash value of each task according to the virtual execution network; The index generation submodule is used to record the hash value, task content, and semaphore of each task as an index of the task list to obtain the task list.
[0081] Optionally, the index generation submodule includes: The task content unit is used to record the task name of each task, the name of the task template corresponding to each task, and the task parameters called by each task as task content in a preset format.
[0082] Optionally, the task execution module 303 includes: The selection submodule is used to determine the task whose semaphore is zero in the task list as the target task, and add the target task to the task queue; The execution submodule is used to send the target task in the task queue to the task executor matching the target task to execute the target task.
[0083] Optionally, the execution submodule includes: A matching unit, used for matching the execution condition of each target task in the task queue with the execution state of each task executor in the plurality of task executors, so as to determine the target task executor in the plurality of task executors; The execution unit is used to send mutually matching target tasks to the target task executor to execute the target tasks.
[0084] Optionally, the task node execution control device 30 based on the data task network further includes: The update module is used to update the semaphore of the target task in the task list according to the execution of the target task.
[0085] In summary, in the embodiment of the present application, by generating a virtual execution network of the task, the dependency between each task node can be clarified, ensuring that the task is executed in the correct order, and improving the accuracy and efficiency of task scheduling; and then the semaphore of each task can be determined according to the virtual execution network, and a task list that records the task semaphore and task content can be generated, so that the priority of task execution can be reasonably allocated, thereby optimizing the execution order of tasks, reducing task waiting time, and improving overall execution efficiency; finally, according to the semaphore of each task, the target task is determined from the task list and the target task is executed, solving the problem of lack of support for dynamic changes in task parameters in the prior art, and using a dynamic adjustment mechanism to effectively avoid the insufficiency of the traditional predefined scheduling table that cannot cope with changes in task parameters, making task execution more flexible and adaptable. Thus, based on the method of the embodiment of the present application, by generating a virtual execution network, determining the semaphore and dynamically adjusting the task execution order, complex data tasks can be efficiently managed and executed, task execution efficiency can be improved, and resource waste can be reduced. The problem of low applicability to complex tasks in the case of dynamic parameters is solved.
[0086] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .
[0087] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0088] The memory 504 is used to store various types of data to support the operation of the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, multimedia, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0089] The power supply component 506 provides power to the various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.
[0090] The multimedia component 508 includes an interface that provides an output interface between the electronic device 500 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0091] The audio component 510 is used to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.
[0092] The input / output I / O interface 512 provides an interface between the processing component 502 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0093] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0094] The communication component 516 is used to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0095] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement the methods provided in the embodiments of the present application.
[0096] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by a processor 520 of an electronic device 500 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0097] Figure 6FIG. 6 is a block diagram of an electronic device 600 according to another embodiment of the present invention. For example, the electronic device 600 may be provided as a server.
[0098] Reference Figure 6 , the electronic device 600 includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632, for storing instructions that can be executed by the processing component 622, such as an application. The application stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the method provided in the embodiment of the present application.
[0099] The electronic device 600 may also include a power supply component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input / output (I / O) interface 658. The electronic device 600 may operate based on an operating system stored in the memory 632, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0100] It should be noted that, for the sake of simplicity, the method embodiments of the present application are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0101] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0102] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A task node execution control method based on a data task network, characterized in that: include: Generating a virtual execution network of the tasks according to a plurality of tasks to be executed; Each virtual execution node in the virtual execution network corresponds one-to-one to each task to be executed; The connection relationship between each virtual execution node in the virtual execution network is used to characterize the execution dependency relationship between the tasks corresponding to each virtual execution node; Determine the semaphore of each task according to the virtual execution network, and generate a task list for recording the semaphore and task content of the task according to the virtual execution network; The semaphore of the task is negatively correlated with the execution priority of the task; Determine a target task from the task list according to the signal amount of each task, and execute the target task; The target task is a task among the tasks that meets the execution condition.
2. The task node execution control method based on the data task network according to claim 1, characterized in that: The step of generating a virtual execution network of the tasks according to the plurality of tasks to be executed includes: Input each of the tasks to be executed into a task format parsing engine to obtain the execution dependency relationship of each of the tasks; The virtual execution network is generated according to all the execution dependencies.
3. The task node execution control method based on the data task network according to claim 1, characterized in that: Determining the semaphore of each task according to the virtual execution network includes: The in-degree of each of the virtual execution nodes in the virtual execution network is calculated, and the in-degree of each of the virtual execution nodes is determined as a semaphore of a task corresponding to each of the virtual execution nodes.
4. The task node execution control method based on the data task network according to claim 1, characterized in that: The step of generating a task list for recording the semaphore and task content of the task according to the virtual execution network includes: Determining a hash value of each of the tasks according to the virtual execution network; The hash value, task content, and semaphore of each task are recorded as an index of the task list to obtain the task list.
5. The task node execution control method based on the data task network according to claim 1, characterized in that: Determining a target task from the task list according to the signal amount of each task, and executing the target task, comprises: Determine the task whose semaphore is zero in the task list as the target task, and add the target task to the task queue; The target task in the task queue is sent to a task executor matching the target task to execute the target task.
6. The task node execution control method based on the data task network according to claim 5, characterized in that: The step of sending the target task in the task queue to a task executor matching the target task to execute the target task includes: Matching the execution condition of each target task in the task queue with the execution state of each of the task executors in the plurality of task executors to determine the target task executor in the plurality of task executors; The target tasks that match each other are sent to the target task executor to execute the target tasks.
7. The task node execution control method based on the data task network according to claim 1, characterized in that: The task node execution control method based on the data task network also includes: According to the execution of the target task, the semaphore of the target task in the task list is updated.
8. A task node execution control device based on a data task network, characterized in that: include: A network generation module, used for generating a virtual execution network of the task according to a plurality of tasks to be executed; Each virtual execution node in the virtual execution network corresponds one-to-one to each task to be executed; The connection relationship between each virtual execution node in the virtual execution network is used to characterize the execution dependency relationship between the tasks corresponding to each virtual execution node; An index generation module, used to determine the semaphore of each task according to the virtual execution network, and generate a task list for recording the semaphore and task content of the task according to the virtual execution network; The semaphore of the task is negatively correlated with the execution priority of the task; A task execution module, used to determine a target task from the task list according to the signal amount of each task, and execute the target task; The target task is a task among the tasks that meets the execution condition.
9. An electronic device, characterized in that: include: A processor, a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Task scheduling method and device
CN106897136A
Intelligent task scheduling method and device, equipment and storage medium
CN110096345A
Task scheduling method, device and system
CN112114956A
Task scheduling method and device and computer readable storage medium
CN113238838A
Task scheduling method and device, electronic equipment, storage medium and program product
CN117234693A
Cited By
Neural network execution method and related apparatus
WO2025228220A1