Task execution method and device, electronic equipment and nonvolatile storage medium

By receiving task requests and determining target node steps, the problem of not being able to determine specific nodes when multi-node task execution fails, achieving efficient continued execution of tasks.

CN119835270APending Publication Date: 2025-04-15CHINA TELECOM INTELLIGENT NETWORK TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411823378.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

When multi-node task execution fails, the specific node that causes the task failure cannot be determined, resulting in inefficient task execution.

Method used

By receiving task requests, determine the task type, and obtain node steps and step dependencies from the database. The target node step is determined based on the resource state record table, that is, the first node step that causes the task execution to fail, and the calling edge node continues to execute the task from the target node step based on the step dependency.

Benefits of technology

Quickly locate the specific reasons for the task failure, ensure that the task continues to be executed from the failed node, and improve the task execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835270A_ABST
    Figure CN119835270A_ABST
Patent Text Reader

Abstract

The invention discloses a task execution method and device, electronic equipment and a nonvolatile storage medium. The method comprises the steps of receiving a task request and determining a task type corresponding to the task request; node steps corresponding to the task type and step dependence of each node are obtained from a database, and the node steps are used for indicating operation performed by edge nodes; when it is determined that the task state of the task is failure, a target node step is determined based on a resource state record table, the resource state record table is used for storing a resource corresponding to each node step and the resource state of the resource, and the resource state is used for indicating the execution condition of the node step corresponding to the resource; the invoking edge node continues to execute the task from the target node step based on the step dependency. According to the method and the device, the technical problem of low efficiency caused by incapability of determining the specific node causing the task failure and incapability of continuously executing the task from the failure node when the execution of the multi-node task fails in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of edge computing, and specifically, to a method, device, electronic device and non-volatile storage medium for executing a task. Background Art

[0002] With the development of edge computing, various application systems push tasks to multiple edge nodes for execution, thereby reducing latency, saving bandwidth resources, and improving application performance. During the execution of tasks, various problems may occur, resulting in task failure. For example, during the execution of tasks, an exception occurs in the resources that need to be relied on, or the execution of the corresponding steps of a node in a multi-node task fails, resulting in task failure.

[0003] In the related art, a task call model is usually used to handle failures during task execution. That is, when a task fails to execute, the entire task request is re-initiated from the perspective of the caller of the task, but the specific steps that caused the task failure cannot be determined. When the entire task request is re-initiated, the entire task can only be re-executed from the node corresponding to the first step. In the above execution process, there are multiple layers of task calls. When the task fails to execute, the task call model needs to re-initiate the task call, so that the task executors at multiple levels re-initiate the task request, resulting in low task execution efficiency. In the related art, when a multi-node task fails to execute, the specific node that caused the task failure cannot be determined and the task cannot be continued from the failed node, resulting in low efficiency.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a task execution method, device, electronic device and non-volatile storage medium to at least solve the technical problem of low efficiency caused by the inability to determine the specific node that caused the task failure and the inability to continue to execute the task from the failed node when the execution of a multi-node task fails in the related art.

[0006] According to one aspect of an embodiment of the present application, a method for executing a task is provided, comprising: receiving a task request and determining a task type corresponding to the task request; obtaining node steps corresponding to the task type and step dependencies of each node from a database, wherein the node steps are used to indicate operations performed by an edge node; when it is determined that the task status of the task is failed, determining a target node step based on a resource status record table, wherein the resource status record table is used to store resources corresponding to each node step and the resource status of the resources, the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution to fail; and calling the edge node to continue executing the task from the target node step based on the step dependency.

[0007] In some embodiments of the present application, the method also includes: in the case where there is no task record for the task in the task record table, wherein the task record table is used to store task records, and the task record stores the task status of the task; creating a task record for the task in the task record table and marking the task status as not started.

[0008] In some embodiments of the present application, when the task status of the task is not started, the method also includes: calling the edge node to execute a node step whose step dependency is empty; after executing the node step whose step dependency is empty, calling the edge node to execute a node step whose step dependency is not empty.

[0009] In some embodiments of the present application, when the task status of a task is failed, the target node step is determined based on the resource status record table, including: obtaining the resources associated with the task in the resource status record table; determining the first resource with a failed resource status among the resources associated with the task as the target resource; and determining the node step corresponding to the target resource as the target node step.

[0010] In some embodiments of the present application, calling an edge node to continue executing a task from a target node step based on a step dependency includes: calling an edge node to execute a target node step; calling an edge node to execute a first node step whose step dependency is empty, wherein the first node step is a node step located after the target node; calling an edge node to execute a first node step whose step dependency is not empty.

[0011] In some embodiments of the present application, the method also includes: in the resource status record table, if the resource status of all resources associated with the task are successful, marking the task status of the task as successful; in the resource status record table, if the resource status of at least one resource associated with the task is failed, marking the task status of the task as failed.

[0012] In some embodiments of the present application, the method also includes: the resource status of the resource in the resource status record table is identified in the following manner: based on the detector, whether the node step corresponding to the resource in the resource status record table is executed according to a preset time interval: when the corresponding node step of the resource is successfully executed within a preset threshold, the resource status of the resource is identified as successful; when the corresponding node step of the resource fails to execute or is not executed or the execution time of the successful execution of the node step exceeds the preset threshold, the resource status of the resource is identified as failed.

[0013] According to another aspect of an embodiment of the present application, a task execution device is also provided, including: a receiving module, used to receive a task request and determine the task type corresponding to the task request; an acquisition module, used to obtain the node steps corresponding to the task type and the step dependencies of each node from a database, wherein the node steps are used to indicate the operations performed by the edge node; a determination module, used to determine the target node step based on a resource status record table when it is determined that the task status of the task is failed, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution to fail; an execution module, used to call the edge node to continue executing the task from the target node step based on the step dependency.

[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a program is stored, wherein when the program is running, a method for executing the above-mentioned task is controlled to execute the device where the non-volatile storage medium is located.

[0015] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the program executes the above-mentioned task execution method when running.

[0016] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the execution method of the above-mentioned task when executed by a processor.

[0017] In an embodiment of the present application, a task request is received and the task type corresponding to the task request is determined; the node step corresponding to the task type and the step dependency of each node are obtained from a database, wherein the node step is used to indicate the operation performed by the edge node; when it is determined that the task status of the task is failed, the target node step is determined based on a resource status record table, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution failure; the edge node is called to continue to execute the task from the target node step based on the step dependency, by determining the task type corresponding to the task request and the node step corresponding to the task type, as well as the step dependency of each node, in the case of task execution failure, the target node step is determined based on the resource status record table, and then the edge node is called to continue to execute the task from the target node step based on the step dependency, thereby achieving the purpose of determining the specific step that causes the task execution failure and continuing to execute the task from the position of the failed step, thereby improving efficiency, thereby solving the technical problem of inefficiency caused by the inability to determine the specific node that causes the task failure and the inability to continue to execute the task from the failed node when the multi-node task execution fails in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a method for executing a task provided in an embodiment of the present application;

[0020] Figure 2 is a flowchart of a method for executing a task provided in an embodiment of the present application;

[0021] Figure 3 It is a schematic diagram of the operation of an orchestration and scheduling system provided according to an embodiment of the present application;

[0022] Figure 4 is a flowchart of another method for executing a task provided according to an embodiment of the present application;

[0023] Figure 5 It is a structural diagram of a task execution device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only 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 should fall within the scope of protection of this application.

[0025] The information collected in the embodiments of the present application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0028] In the edge computing (Multi-access Edge Computing, referred to as MEC) architecture, the central node (Multi-access Edge Orchestrator, referred to as MEO) and the edge node (Multi-access Edge Platform Manager, referred to as MEPM) are two key components, playing an important role in managing and orchestrating edge computing resources and services.

[0029] Central node (MEO): Located at the core of the entire MEC network, it is responsible for global resource and service management, including resource discovery, allocation, scheduling, service deployment, update and uninstallation. MEO is also responsible for coordination across multiple MEPM edge nodes to ensure the optimal allocation of resources and services. It is usually tightly integrated with the core part of the network, able to access a wider range of network resources and data, and provide guidance and support for edge nodes.

[0030] Edge Nodes (MEPM): These nodes are deployed at the edge of the network, close to users and devices. They interact directly with local physical and virtual resources and execute instructions issued by MEO, such as creating virtual machines, configuring network services, etc. MEPM can quickly respond to local computing needs, reduce data transmission delays, and improve service efficiency. Each MEPM manages resources in its geographic location and maintains communication with MEO to report its status and execution results.

[0031] In the related art, for the failure in the task execution process, the task call model is usually used to handle it, that is, when the task execution fails, from the perspective of the caller of the task, the entire task request is re-initiated, and the specific steps that caused the task failure cannot be determined. When the entire task request is re-initiated, the entire task can only be re-executed from the node corresponding to the first step. Therefore, there is a problem of low efficiency caused by the inability to determine the specific node that caused the task failure and the inability to continue to execute the task from the failed node in the related art when the multi-node task execution fails. In order to solve this problem, a relevant solution is provided in the embodiment of the present application.

[0032] According to an embodiment of the present application, an embodiment of a method for executing a task is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0033] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a method for executing a task. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0034] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0035] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the execution method of the task in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the execution method of the above-mentioned task. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0037] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .

[0038] In the above-mentioned operating environment, the embodiments of the present application provide embodiments of a method for executing a task. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] like Figure 2 FIG. 1 is a flowchart of a method for executing a task according to an embodiment of the present application, comprising:

[0040] Step S202: receiving a task request and determining the task type corresponding to the task request.

[0041] In the technical solution provided in step S202, after receiving the task request, (the scheduler of the orchestration and scheduling system) determines the task type corresponding to the task in the task request, and the task type is pre-defined. The node steps of the tasks of the same task type, the order of executing the node steps, the sequence, and the step dependency are consistent, but the specific resource parameters of different tasks are different. The node steps corresponding to different task types, the order of executing the node steps, the sequence, and the step dependency are pre-stored in the task type table in the database. The following Table 1 is the task execution information corresponding to the task of task type 1. As shown in Table 1, the function id is used to indicate the task type, the step id is used to indicate the id of different node steps, which is the unique identifier of different node steps, the step name is the node step, which is used to indicate the specific atomic operation performed by the edge node, and the step dependency is used to indicate the sequence of executing the node steps. As shown in Table 1, the node step "create virtual machine" has step dependency "1, 2", which means that the node step can only be executed when the node step with step id "1, 2" is executed. When the step dependency is empty, it means that there is no step dependency.

[0042] Table 1

[0043] Function id Step id Step Name Step Dependencies 1 1 Create a security group 1 2 Create a VPC 1 3 Creating a virtual machine 1,2

[0044] Step S204, obtaining the node steps corresponding to the task type and the step dependencies of each node from the database, wherein the node steps are used to indicate the operations performed by the edge node.

[0045] In the technical solution provided in step S204, when there is no task record of the task in the task record table, the task record table is used to store the task record, and the task status of the task is stored in the task record; a task record is created for the task in the task record table and the task status is marked as not started. In the case where the task status of the task is not started (that is, the task in the task request is a new task), the task can be executed in the following ways: calling the edge node to execute the node step whose step dependency is empty; after executing the node step whose step dependency is empty, calling the edge node to execute the node step whose step dependency is not empty. This task scheduling mechanism based on dependency relationships can ensure the orderly execution of tasks, avoid resource conflicts and task confusion, and is particularly suitable for complex edge computing tasks that require multi-step collaborative processing, such as video stream analysis, large-scale data processing and other scenarios. This step ensures that each task has a record of its execution status, which is convenient for subsequent tracking and management, especially in the distributed environment of edge computing, which can help the central node better monitor and control the execution process of the task, and is suitable for edge computing monitoring and maintenance scenarios.

[0046] The task record of the task is stored in the task record table of the database. If the task in the task request is a new task, that is, there is no task record of the task in the task record table, then a task record is created for the task in the task record table, and the task status is marked as not started, including task id, which is the unique identifier of the task, function id, which is the same as the function id in Table 1, and is used to indicate that the task type table and the task record table are associated through the function id. The resource status record table is shown in Table 3, which is used to store the resources corresponding to each node step and the resource status of the resources. The resource status is used to indicate the execution status of the node step corresponding to the resource. The resource status record table includes task id, step id, resource id, resource status, and number of checks. Task id (task id is the same as the task id in the task record table, and the resource status record table is associated with the task record table through the task id), step id (step id is the same as the step id in the task type table, and the resource status record table is associated with the task type table through the step id), resource di, resource id is used to indicate the unique identifier of the resource corresponding to each node step, and the resource status includes: running, success, and failure. The initial state of the resource status is running. When the resource status is updated, the resource status in the resource status record table is marked in the following ways:

[0047] Based on the detector, detect whether the node steps corresponding to the resources in the resource status record table are executed according to the preset time interval (for example, the detector can read the status reported by all edge nodes from the database according to the preset time interval, and the status is the progress of the node steps executed by each edge node. For example, a progress of 100 indicates that the node step is executed successfully): when the corresponding node step of the resource is successfully executed within the preset threshold, the resource status of the resource is marked as successful; when the corresponding node step of the resource fails to execute or is not executed or the execution time of the successful execution of the node step exceeds the preset threshold (for example, 30 minutes), the resource status of the resource is marked as failed. If there is no execution result and it does not exceed the preset threshold, no processing is performed, and wait for the next detection of the preset time interval.

[0048] This real-time monitoring and status marking mechanism can ensure that problems in the task execution process can be discovered and handled in a timely manner, and is particularly suitable for edge computing scenarios with high real-time and reliability requirements. The task status in the task status record table includes success, failure, and unexecuted. The task status of all new tasks is marked as unexecuted. In the resource status record table, if the resource status of all resources associated with the task is successful, the task status of the task is marked as successful; in the resource status record table, if the resource status of at least one resource associated with the task is failed, the task status of the task is marked as failed.

[0049] The following are specific embodiments:

[0050] The task record table is shown in Table 2. For the first record, the task with task id 1 is a new task, and the task status is incomplete. When the task status is incomplete, the task is executed in the following way: (the scheduler of the orchestration and scheduling system) determines the task type (i.e., function id) associated with the task, and the function id of the task type corresponding to the task with task id 1 is 1. The node steps corresponding to the task type and the step dependencies of each node are obtained from the database, that is, the data of the task type with function id 1 is obtained from the data type table in the database, as shown in Table 1, which includes 3 step names (i.e., node steps). The node step with step id 1 is to create a security group, and there is no step dependency; the node step with step id 2 is to create a virtual private cloud (Virtual Private Cloud, referred to as VPC), and there is no step dependency; the node step with step id 3 is to create a virtual machine, and there is a step dependency "1, 2", that is, the node steps with step ids 1 and 2 need to be completed before the step can be completed. Call the edge node (referring to one or more edge nodes that complete the node steps) to execute the node steps with empty step dependencies: that is, the node steps with step ids 1 and 2, and the two steps can be executed in parallel; after executing the node steps with empty step dependencies, call the edge node to execute the node steps with non-empty step dependencies: execute the node steps with step id 3. As shown in Table 3, based on the detector detecting whether the node steps corresponding to the resources in the resource status record table are executed at preset time intervals (for example, once every five minutes when the task starts to execute), the resource status of the resource ids "1, 2, 3" corresponding to the task with task id 1 are all successful, where the number of checks refers to the number of preset time intervals within which the resource status of the resource is finally determined. If the task with task id 1 is executed successfully, the task status corresponding to the task with task id 1 in Table 2 will be marked as successful, and the next task request can be received thereafter.

[0051] Table 2

[0052] Task id Function id Task Status 1 1 Unfinished 2 1 fail

[0053] Table 3

[0054]

[0055]

[0056] Step S206, when it is determined that the task status of the task is failed, the target node step is determined based on the resource status record table, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, and the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution to fail. This method can quickly locate the specific cause of the task failure, which helps to solve the problem in a timely manner, and is particularly suitable for scenarios of resource management and troubleshooting in edge computing.

[0057] In the technical solution provided in step S206, when the task status of the task is failed, there are multiple ways to implement the determination of the target node step based on the resource status record table, for example: obtaining the resources associated with the task in the resource status record table; determining the first resource with a failed resource status among the resources associated with the task as the target resource; determining the node step corresponding to the target resource as the target node step.

[0058] It should be noted that there are multiple ways to implement the above steps of calling the edge node to continue executing the task from the target node step based on the step dependency. For example, the following methods are used to call the edge node to continue executing the task from the target node step based on the step dependency: calling the edge node to execute the target node step; calling the edge node to execute the first node step whose step dependency is empty, where the first node step is the node step located after the target node; calling the edge node to execute the first node step whose step dependency is not empty. This mechanism can ensure that the task can be restarted from the correct node after failure, avoiding unnecessary waste of resources, and is particularly suitable for scenarios of task recovery and resource optimization in edge computing.

[0059] Step S208, calling the edge node to continue executing the task from the target node step based on the step dependency.

[0060] In the technical solution provided in step S208, there are multiple ways to implement calling the edge node to continue executing the task from the target node step based on the step dependency. For example, calling the edge node to continue executing the task from the target node step based on the step dependency is carried out in the following ways: calling the edge node to execute the target node step; calling the edge node to execute the first node step whose step dependency is empty, wherein the first node step is the node step located after the target node; calling the edge node to execute the first node step whose step dependency is not empty.

[0061] The following are specific embodiments:

[0062] As shown in Table 2, the task with task id 2 has a task status of failure in the task record, indicating that the task is an existing task, that is, a task that has been executed before but failed. For this type of task, (the scheduler of the orchestration and scheduling system) obtains the resources associated with the task in the resource status record table; determines the first resource with a failed resource status among the resources associated with the task as the target resource; determines the node step corresponding to the target resource as the target node step, and uses the edge node to execute the target node step; calls the edge node to execute the first node step whose step dependency is empty, wherein the first node step is the node step located after the target node; calls the edge node to execute the first node step whose step dependency is not empty. Specifically: the task with task id 2 is associated with resources with resource ids 4, 5, and 6 in the resource status record table as shown in Table 3. The function id associated with the task with task id 2 is 1. The task type with function id 1 in association table 1 has three step ids. The node step with step id 1 is to create a security group, and there is no step dependency; the node step with step id 2 is to create a virtual private cloud (VPC), and there is no step dependency; the node step with step id 3 is to create a virtual machine, and there is a step dependency "1, 2". As shown in Table 3, the first resource with a failed state among the resources associated with the task is the resource with resource id 6, so this resource is used as the target resource. The node step corresponding to the target resource in Table 1 is the node step with step id 3, and there is a step dependency "1, 2". The node step with step id 3 is used as the target node step, and the edge node is called to execute the target node step: execute the node step with step id 3. If the step is not the last step, the edge node is called to execute the first node step with an empty step dependency, wherein the first node step is the node step located after the target node; the edge node is called to execute the first node step with a non-empty step dependency. For example, if there are node steps with step id 4 and 5 after the node step with step id 3, where the node step with step id 4 has no step dependency and the node step with step id 5 has step dependency 4, then continue to call the node step with edge node step id 4, and then call the node step with edge node step id 5. It should be noted that during the task execution process, when the detector (the detector of the orchestration and scheduling system) detects that the resource status of the resource is failed, the scheduler of the orchestration and scheduling system is immediately triggered to stop the task.

[0063] Through the above steps, the orderly execution of edge computing tasks can be ensured, the execution confusion caused by task type identification errors can be avoided, and the task processing efficiency of the edge computing system can be improved. In scenarios such as the smart Internet of Things, this method can quickly respond to user needs, achieve efficient scheduling and execution of tasks, and meet various customized task requirements generated by users based on their own needs. Customize the atomic operations corresponding to each node step in series, the system determines the execution result of each step by itself, and can re-execute the task from the failed step.

[0064] The embodiment of the present application also provides a schematic diagram of the operation of the scheduling system, such as Figure 3 As shown, it is a schematic diagram of the operation of the orchestration and scheduling system involved in the embodiment of the present application, including a central node (MEO) and an edge node (MPEM). The central node is the core of task management. MEO and MEPM communicate through an interface. The characteristic of this communication mode is that all communication requests and responses are in a unified format, that is, JSON format, for data transmission. On the MEO side, in order to simplify the communication with MEPM, a parameter encapsulation class is designed. This encapsulation class integrates the uniform resource locator (UniformResourceLocator, referred to as URL) suffix of the network request, the name of the resource, the ID of the resource, and the specific parameter information. When MEO needs to communicate with MEPM, it only needs to call the method of the interface, and according to different URL suffixes and parameter combinations, different instructions can be passed to MEPM to perform atomic operations corresponding to different node steps. In the process of creating certain resources by atomic operations, the ID of the resource may be assigned only after the creation is completed, such as disks, virtual machines, etc. Before creation, each resource has a unique name as a temporary identifier, which is used in the creation parameters. When MEO is assembling the parameters of a task, if it encounters a situation where a resource ID is needed as a parameter, but the resource has not yet been created and the ID cannot be determined, MEO will use the name of the resource as a placeholder and insert it into the parameter. When the MEPM execution node step is actually called, the MEO scheduler will first check all parameters, find all placeholders in the form of names, and replace them with the ID of the resource that was actually created successfully.

[0065] The specific execution process of the orchestration and scheduling system is as follows: First, the node steps related to a specific task type (one entry for each type of work, for example, task type A, task type B, and task type C in the figure) and the dependencies between these node steps are obtained from the database associated with MEO. Then the scheduler will receive the parameters of the resources of each node step corresponding to the pre-configured task, and call the edge node to perform the corresponding atomic operation A and atomic operation B (atomic operation corresponding to the node step) through the atomic operation entry. The detector is used to determine the resource status of the resources during the task execution process, including the atomic operation A check method, the atomic operation B check method, etc. These check methods are used to verify whether the node steps corresponding to task type A, task type B, and task type C (atomic operation A, atomic operation B, atomic operation C) are successfully executed. The entire process tracks the execution of each node step through the resource status of the resource status record table (that is, the above-mentioned detector detects whether the node steps corresponding to the resources in the resource status record table are executed according to the preset time interval), so that when the task execution fails, it can accurately identify which node step caused the failure, so as to restart the task execution at the failed node step, avoiding the waste of resources and improving the efficiency of task execution.

[0066] The present application embodiment also provides a flowchart of another task execution method, such as Figure 4As shown in the figure, it shows the process of a task from start to finish. The scheduler of the central node MEC starts when receiving the task request. It first determines whether the task in the task request is a new task. If it is a new task, a new task is created (that is, in the case where there is no task record of the task in the task record table, the task record table is used to store task records, and the task record stores the task status of the task; a task record is created for the task in the task record table and the task status is marked as not started). Then it determines whether there are any steps (that is, determine the node steps corresponding to the task type of the task). If there are steps, call the edge node to perform atomic operations (that is, call the edge node to execute the node step with empty step dependency, and after executing the node step with empty step dependency, call the edge node to execute the node step with non-empty step dependency). Then, the timed task is used. The task checks the atomic operation result (the result of the atomic operation of the edge node), that is, based on the detector, detects whether the node steps corresponding to the resources in the resource status record table are executed according to the preset time interval. If the atomic operation result shows success (that is, if the resource status of all resources associated with the above task are successful, the task status of the task is marked as successful), the task is terminated, otherwise the task is re-executed (that is, when the task status of the task is determined to be failed, the target node step is determined based on the resource status record table, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, and the resource status is used to indicate the execution status of the node steps corresponding to the resources, and the target node step is the first node step that causes the task execution to fail; the edge node is called to continue to execute the task from the target node step based on the step dependency). The task is terminated directly if the step does not exist.

[0067] The present application embodiment provides a task execution device, such as Figure 5 As shown, including:

[0068] The receiving module 502 is used to receive a task request and determine the task type corresponding to the task request.

[0069] The acquisition module 504 is used to acquire the node steps corresponding to the task type and the step dependencies of each node from the database, wherein the node steps are used to indicate the operations performed by the edge node.

[0070] Determination module 506 is used to determine the target node step based on the resource status record table when it is determined that the task status of the task is failed, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, and the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution failure.

[0071] The determination module 506 is also used to obtain resources associated with the task in the resource status record table; determine the first resource with a failed resource status among the resources associated with the task as the target resource; and determine the node step corresponding to the target resource as the target node step.

[0072] The execution module 508 is used to call the edge node to continue executing the task from the target node step based on the step dependency.

[0073] The execution module 508 is also used to call the edge node to execute the target node step; call the edge node to execute the step dependency of the first node step which is empty, wherein the first node step is the node step located after the target node; call the edge node to execute the step dependency of the first node step which is not empty.

[0074] The execution module 508 is also used to detect whether the node steps corresponding to the resources in the resource status record table are executed based on the detector at preset time intervals: when the corresponding node steps of the resource are successfully executed within the preset threshold, the resource status of the resource is marked as successful; when the corresponding node steps of the resource fail to execute or are not executed or the execution time of the successful execution of the node steps exceeds the preset threshold, the resource status of the resource is marked as failed.

[0075] It should be noted that Figure 5 The execution device of the task shown is used to execute Figure 2 The execution method of the task shown is therefore Figure 2 The relevant explanations and instructions in the method for executing the task in are also applicable to the device for executing the task, and will not be repeated here.

[0076] It should be noted that the various modules in the execution device of the above-mentioned tasks can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0077] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to perform the above-mentioned task execution method. For example, receiving a task request and determining the task type corresponding to the task request; obtaining the node steps corresponding to the task type and the step dependencies of each node from the database, wherein the node steps are used to indicate the operations performed by the edge node; in the case of determining that the task status of the task is failed, determining the target node step based on the resource status record table, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, and the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution to fail; calling the edge node to continue to execute the task from the target node step based on the step dependency.

[0078] The embodiment of the present application also provides an electronic device, the electronic device includes a processor, the processor is used to run a program, wherein the execution method of the above task is executed when the program is running. For example, a task request is received and the task type corresponding to the task request is determined; the node steps corresponding to the task type and the step dependencies of each node are obtained from the database, wherein the node steps are used to indicate the operations performed by the edge node; when it is determined that the task status of the task is failed, the target node step is determined based on the resource status record table, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, and the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution to fail; the edge node is called to continue to execute the task from the target node step based on the step dependency.

[0079] According to another aspect of the embodiment of the present application, a computer program product is also provided, including a computer program, which implements the above task execution method when executed by a processor. For example, a task request is received and the task type corresponding to the task request is determined; the node step corresponding to the task type and the step dependency of each node are obtained from the database, wherein the node step is used to indicate the operation performed by the edge node; when the task status of the task is determined to be failed, the target node step is determined based on the resource status record table, wherein the resource status record table is used to store the resources corresponding to each node step and the resource status of the resources, and the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution to fail; the edge node is called to continue to execute the task from the target node step based on the step dependency.

[0080] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0081] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0082] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0083] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0084] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0085] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for executing a task, characterized in that: include: Receiving a task request and determining a task type corresponding to the task request; Obtaining node steps corresponding to the task type and step dependencies of each node from a database, wherein the node steps are used to indicate operations performed by edge nodes; In the case where it is determined that the task status of the task is failed, determining the target node step based on the resource status record table, wherein the resource status record table is used to store the resources corresponding to each of the node steps and the resource status of the resources, the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution failure; The edge node is called to continue executing the task from the target node step based on the step dependency.

2. The method according to claim 1, characterized in that The method further comprises: In the case where there is no task record of the task in the task record table, wherein the task record table is used to store task records, and the task record stores the task status of the task; A task record is created for the task in the task record table and a status of the task is marked as not started.

3. The method according to claim 2, characterized in that When the task status of the task is not started, the method further includes: Calling the edge node to execute the node step whose step dependency is empty; When the node step whose step dependency is empty is executed, the edge node is called to execute the node step whose step dependency is not empty.

4. The method according to claim 1, characterized in that When the task status of the task is failed, the step of determining the target node based on the resource status record table includes: Obtaining resources associated with the task in the resource status record table; Determine the first resource whose resource status is failed among the resources associated with the task as the target resource; The node step corresponding to the target resource is determined as the target node step.

5. The method according to claim 1, characterized in that The calling edge node continues to execute the task from the target node step based on the step dependency, including: Calling the edge node to execute the target node step; Calling the edge node to execute the first node step whose step dependency is empty, wherein the first node step is a node step located after the target node; Calling the edge node to execute the step depends on the first node step which is not empty.

6. The method according to claim 1, characterized in that The method further comprises: In the resource status record table, if the resource statuses of all resources associated with the task are all successful, marking the task status of the task as successful; In the resource status record table, if the resource status of at least one resource associated with the task is failed, the task status of the task is marked as failed.

7. The method according to claim 6, characterized in that The method further includes: the resource status of the resource in the resource status record table is identified in the following manner: Based on the detector detecting at a preset time interval whether the node step corresponding to the resource in the resource status record table is executed: In the case where the node step corresponding to the resource is successfully executed within a preset threshold, marking the resource state of the resource as successful; In the case that the node step corresponding to the resource fails to execute or is not executed or the execution time of the node step successfully executed exceeds the preset threshold, the resource state of the resource is marked as failed.

8. A task execution device, characterized in that: include: A receiving module, used for receiving a task request and determining a task type corresponding to the task request; An acquisition module, used to acquire the node steps corresponding to the task type and the step dependencies of each node from a database, wherein the node steps are used to indicate the operations performed by the edge node; A determination module, configured to determine a target node step based on a resource status record table when it is determined that the task status of the task is a failure, wherein the resource status record table is used to store resources corresponding to each of the node steps and the resource status of the resources, the resource status is used to indicate the execution status of the node step corresponding to the resource, and the target node step is the first node step that causes the task execution to fail; The execution module is used to call the edge node to continue executing the task from the target node step based on the step dependency.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for executing the task described in any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the method for executing the task described in any one of claims 1 to 7 when running.

11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method for executing the task described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Job scheduling method, system and device, communication equipment and storage medium

    CN116302452A

  • Task execution method, device and equipment

    CN116339958A

  • Task processing method and device and node

    CN118093104A

  • Task failure processing method, device and equipment and computer storage medium

    CN118860703A

  • Task scheduling based on dependencies and resources

    US20110321051A1