Task execution method, task execution device and electronic equipment

By obtaining task attribute information to determine resource grouping and priorities, and dynamically allocate resources, the problem that task scheduling schemes cannot be flexibly adjusted in the existing technology is solved, and task execution efficiency and resource utilization are improved.

CN118916157APending Publication Date: 2024-11-08BEIJING ZIJING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410950266.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing task scheduling scheme cannot be flexibly adjusted dynamically according to different tasks, resulting in low resource allocation efficiency and waste, and cannot meet the requirements of task completion quality and timeliness.

Method used

By obtaining the attribute information of the task, determining the resource grouping and priority of the task, dynamically allocating the target resource type and achieving flexible scheduling of the task.

Benefits of technology

It improves task execution efficiency, avoids resource waste, improves resource utilization, and adapts to the needs of different task situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916157A_ABST
    Figure CN118916157A_ABST
Patent Text Reader

Abstract

The invention discloses a task execution method, a task execution device and electronic equipment, and relates to the field of data processing. Each task can be flexibly scheduled, and the task scheduling efficiency is improved. The task execution method comprises the steps of obtaining a to-be-executed task, and extracting attribute information of the to-be-executed task; determining resource groups and priorities of the tasks to be executed according to the attribute information; determining a target resource type required by the to-be-executed task according to the resource group; obtaining executable resources of each resource type, and allocating the executable resources corresponding to the target resource type to the to-be-executed task from the executable resources according to the priority; and executing the to-be-executed task based on the allocated executable resources to obtain a task execution result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a task execution method, a task execution device and an electronic device. Background Art

[0002] The commonly used task scheduling scheme is to execute tasks in order according to established rules. That is, when a task arrives, it is executed in order according to the execution order of the task that has been assigned. The specific rules used include time sorting, shortest job sorting, unit time slice rotation sorting, etc. However, in actual situations, some of the tasks assigned are biased towards task completion quality and have low requirements for timeliness, while others are biased towards task completion timeliness. Even if the task fails to execute, it is necessary to respond to the upstream system in a timely manner. The current task scheduling rules cannot be flexibly adjusted dynamically according to different situations. Summary of the invention

[0003] The present application provides a task execution method, a task execution device and an electronic device, which can determine the priority of a task according to the attributes of the task, so as to flexibly schedule each task.

[0004] In a first aspect, the present application provides a task execution method, comprising:

[0005] Obtaining a task to be executed, and extracting attribute information of the task to be executed;

[0006] Determine the resource grouping and priority of the task to be executed according to the attribute information;

[0007] Determining the target resource type required for the task to be performed according to the resource grouping;

[0008] Obtaining executable resources of each resource type, and allocating executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority;

[0009] The to-be-executed task is executed based on the allocated executable resources to obtain a task execution result.

[0010] According to the task execution method provided in this embodiment, when executing a task, the required target resource type and priority are determined based on the attribute information of the task itself, so that resources are allocated to each task for execution based on the priority. This can adapt to the situations of different tasks, enhance the flexibility of task scheduling, improve the execution efficiency of tasks, and at the same time avoid waste of resources and improve resource utilization.

[0011] In a second aspect, the present application provides a task execution device, comprising:

[0012] A task acquisition module, used to acquire tasks to be executed and extract attribute information of the tasks to be executed;

[0013] A task grouping module, used to determine the resource grouping and priority of the task to be executed according to the attribute information;

[0014] A resource determination module, used to determine the target resource type required for the task to be executed according to the resource grouping;

[0015] A resource allocation module, used for acquiring executable resources of various resource types, and allocating executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority;

[0016] The task execution module is used to execute the to-be-executed task based on the allocated executable resources to obtain a task execution result.

[0017] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and one or more processors. The memory stores one or more computer programs, the computer programs comprising instructions, and when the instructions are executed by the processor, the electronic device can execute the task execution method in the first aspect.

[0018] In a fourth aspect, the present application provides a computer-readable medium having instructions stored therein, and when the instructions are executed on an electronic device, the electronic device executes the task execution method in the first aspect.

[0019] In a fifth aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the task execution method as described in the first aspect.

[0020] It can be understood that the beneficial effects that can be achieved by the task execution device, electronic device, computer-readable medium, and computer program product provided above can refer to the beneficial effects in the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a task execution method provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of the structure of a task execution device provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.

[0025] It should be noted that the “at…” in the embodiments of the present application may be the instant when a certain situation occurs, or may be a period of time after the occurrence of a certain situation, and the embodiments of the present application do not specifically limit this.

[0026] The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.

[0027] This embodiment provides a task execution method. By way of example, the task execution method can be applied to various electronic devices such as computers (PCs), tablet computers, virtual reality / augmented reality devices, wearable devices, industrial computers, and vehicle computers; it can also be applied to servers, cloud computing, server clusters, etc. This embodiment does not make any special limitations on this.

[0028] Figure 1 A flowchart of a task execution method provided in an embodiment of the present application is shown.

[0029] like Figure 1 As shown, the task execution method may include the following steps:

[0030] Step 101: Obtain a task to be executed, and extract attribute information of the task to be executed.

[0031] Among them, the tasks to be executed are tasks issued by the upstream system, and the upstream system can be various applications. The tasks to be executed can specifically be data update tasks, data collection tasks, financial data reporting tasks, financial data analysis tasks, etc.

[0032] The tasks to be performed may include the task content, task time, and attribute information of the task. The attribute information may refer to the information of the tasks to be performed, such as the business type, business organization, etc., or may refer to the information of the upstream system that issues the tasks to be performed, such as the system name, region, etc. In this embodiment, the attribute information includes region, business type, and business organization.

[0033] Step 102: Determine the resource grouping and priority of the task to be executed according to the attribute information.

[0034] In this implementation, the resource grouping of the task to be executed can be determined according to the business type in the attribute information. The correspondence between the resource grouping and the business type can be preset. Different resource groups can correspond to different resource types, such as third-party interfaces, automatic execution programs, server resources, etc. required to execute the task. Among them, the automatic execution program is a program configured to automatically execute the task, which can also be called a robot.

[0035] There is a priority relationship between different attribute information. In this implementation, tree data is used to define the priority relationship between attribute information. There is a node order relationship between the nodes of the tree data, for example, the parent node is before the child node, the left child node is before the right child node, and so on. Figure 2 As shown, the priority of attribute information A1 is higher than that of attribute information B1, attribute information B2, the priority of attribute information B1 is the same as that of attribute information B2, and the priority of attribute information B1 is higher than that of attribute information C1, attribute information C2, etc. In general, in tree data, the priority of nodes at the previous level is higher than that of nodes at the next level, and the priorities of nodes at the same level can be the same; or, for nodes at the same level, the priority of the left node can also be higher than that of the right node, which is set according to the actual needs of the user, and this embodiment is not limited to this.

[0036] Step 103: Determine the target resource type required for the task to be executed according to the resource grouping.

[0037] The target resource type is the resource type corresponding to the task to be executed.

[0038] Step 104: Obtain executable resources of each resource type, and allocate executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority.

[0039] The executable resources are idle resources, and the currently idle resources can be determined based on the recorded resource usage. This implementation may also include: determining the number of executable resources of each resource type; when the number meets a preset condition, allocating executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority.

[0040] The preset condition may be that the number of executable resources is not less than the minimum number. The minimum number of each resource type may be different. When the number of executable resources of a certain resource type does not meet the preset condition, a prompt message may be sent to prompt the user to wait. For example, when the number of executable resources of one resource type is 0, the resource cannot be allocated, and a prompt message is sent to the application that sends the task to be executed, or a prompt message may be displayed.

[0041] Specifically, allocating the executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority includes: obtaining tree data, the nodes of the tree data are attribute information; determining the priority between each of the tasks to be executed based on the node order of the attribute information of each of the tasks to be executed in the tree data, and obtaining the target task with the highest priority; and allocating the corresponding executable resources to the target task from the executable resources.

[0042] By querying the tree data, the attribute information with the highest priority can be determined, and the to-be-executed task corresponding to the attribute information with the highest priority can be used as the target task. Figure 2 If the attribute information of the task a to be executed is A1, it can be determined that the task a to be executed is the task with the highest priority, that is, the target task.

[0043] In specific application scenarios, when the number of tasks exceeds tens of thousands, hundreds of thousands, or even millions, the performance of ordinary scheduling algorithms will drop sharply. This embodiment extracts the business feature values ​​of each task and sets tree attributes at different levels to screen out the best executable tasks. At the same time, the scheduling rate is always maintained at a high speed to ensure that resources are not wasted. Each priority can also be adjusted at any time according to business needs and take effect dynamically in real time.

[0044] This implementation can also determine the priority of the task to be executed in combination with the resource type and attribute information. Specifically, allocating the executable resource corresponding to the target resource type to the task to be executed from the executable resources according to the priority includes: screening out the target task whose target resource type is a specific type; sorting the target task according to the priority corresponding to the attribute information of the target task; and allocating the corresponding executable resource to the target task in the order of the sorting.

[0045] A specific type is one of the resource types. For example, if the resource types include server resources, third-party interfaces, and robots, the third-party interfaces and robots can be specific types. The specific type is set to have the highest priority. When the target resource types required by the task to be executed are third-party interfaces and robots, the task to be executed can be selected as the target task. Then, among multiple target tasks, the priority order is determined based on the attribute information of each target task, and the corresponding resources are allocated to each target task according to the priority order.

[0046] Some resources may be resources that rely on external platforms, i.e., external resources, such as third-party interfaces, robots, etc. External resources are easily restricted. In this embodiment, external resources are allocated first, which can improve the utilization rate of external resources. When external resources are idle, they are allocated as soon as possible to avoid task waiting due to insufficient external resources, thereby shortening the duration of task execution and improving the efficiency of task execution.

[0047] Step 105: Execute the task to be executed based on the allocated executable resources to obtain a task execution result.

[0048] The task execution result may include indication information indicating whether the execution is successful, as well as return data required by the task, etc.

[0049] This implementation also includes: acquiring the task status of the task to be executed; and displaying the task status on the first visual interface.

[0050] Exemplarily, the task status may include three states: to be executed, being executed, and task completed. Starting from when the task to be executed is acquired in step 101, the task status of the task to be executed may be updated once every preset time period. The task status is displayed in the first visual interface. This embodiment provides a visual interface that can fully record the life cycle of the entire task, making it easier for users to monitor the execution of the task.

[0051] The graphical interactive interface that displays the task status may be referred to as a first visualization interface. This embodiment may also include a second visualization interface. Specifically: displaying the second visualization interface, in which each task to be executed is displayed in order of priority; receiving a user's modification operation; and adjusting the order of each task to be executed based on the modification operation.

[0052] In the second visual interface, the tasks to be executed are arranged in order from high to low according to the priority of each task to be executed, so that the user can intuitively understand the execution order of each task to be executed. The modification operation may include interactive operations such as clicking, sliding, dragging, and inputting. The user can adjust the order of the tasks to be executed through interactive operations such as clicking and sliding, for example, dragging the task to be executed a from the second place to the first place. When the electronic device receives the user's modification operation, it determines the tasks to be executed that the user wants to adjust and the order in which the tasks to be executed are to be adjusted according to the modification operation, thereby adjusting the order of the tasks to be executed. This embodiment provides the user with the function of adjusting the execution order of tasks by means of a visual interface, which can more flexibly adapt to the needs of different tasks, thereby scheduling resources.

[0053] This implementation also includes: acquiring the executed task whose task status is task completion; generating a task report based on the execution information of the executed task, and displaying the task report.

[0054] The execution information may include the number of successful task executions, the number of failed task executions, and the average duration of task execution, etc., but the present implementation is not limited thereto.

[0055] Furthermore, this embodiment also provides a task execution device, which can be used to execute the above-mentioned task execution method.

[0056] like Figure 2 As shown, the task execution device 200 may include the following: a task acquisition module 201, used to acquire the task to be executed and extract the attribute information of the task to be executed; a task grouping module 202, used to determine the resource grouping and priority of the task to be executed according to the attribute information; a resource determination module 203, used to determine the target resource type required for the task to be executed according to the resource grouping; a resource allocation module 204, used to acquire executable resources of each resource type, and allocate the executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority; a task execution module 205, used to execute the task to be executed based on the allocated executable resources to obtain the task execution result.

[0057] In an exemplary embodiment, it also includes: a status synchronization module, used to obtain the task status of the task to be executed; and a first display module, used to display the task status on a first visual interface.

[0058] In an exemplary embodiment, the resource allocation module 204 is specifically used to: determine the number of executable resources of each resource type; when the number meets a preset condition, allocate executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority.

[0059] In an exemplary embodiment, the resource allocation module 204 is specifically used to: obtain tree data, the nodes of the tree data are attribute information; determine the priority between each of the tasks to be executed based on the node order of the attribute information of each of the tasks to be executed in the tree data, and obtain the target task with the highest priority; and allocate corresponding executable resources to the target task from the executable resources.

[0060] In an exemplary embodiment, the resource allocation module 204 is specifically used to: filter out target tasks whose target resource type is a specific type; sort the target tasks according to the priority corresponding to the attribute information of the target tasks; and allocate corresponding executable resources to the target tasks in the order of the sorting.

[0061] In an exemplary embodiment, it also includes: a second display module for displaying a second visual interface, in which each task to be executed is displayed in order of priority; an operation module for receiving a user's modification operation; and a sequence adjustment module for adjusting the sequence of each task to be executed based on the modification operation.

[0062] In an exemplary embodiment, the task status includes pending execution, executing, and task completed, and also includes: a report display module for obtaining executed tasks whose task status is task completed; generating a task report based on the execution information of the executed tasks, and displaying the task report.

[0063] The specific details of each module or unit in the above-mentioned task execution device have been described in detail in the corresponding task execution method, so they will not be repeated here.

[0064] The embodiment of the present application also provides an electronic device, Figure 3 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 3 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0065] like Figure 3 As shown, electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In RAM 603, various programs and data required for system operation are also stored. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.

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

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

[0068] For example, when the computer program is executed by the central processing unit (CPU) 601, it can perform the following: obtain the task to be executed, and extract the attribute information of the task to be executed; determine the resource grouping and priority of the task to be executed based on the attribute information; determine the target resource type required for the task to be executed based on the resource grouping; obtain executable resources of each resource type, and allocate executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority; execute the task to be executed based on the allocated executable resources to obtain the task execution result.

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

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

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

[0072] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and the one or more programs include instructions, and when the instructions are executed by the electronic device, the electronic device implements the method described in the above embodiment.

[0073] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0074] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A task execution method, characterized in that: include: Obtaining a task to be executed, and extracting attribute information of the task to be executed; Determine the resource grouping and priority of the task to be executed according to the attribute information; Determining the target resource type required for the task to be performed according to the resource grouping; Obtaining executable resources of each resource type, and allocating executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority; The to-be-executed task is executed based on the allocated executable resources to obtain a task execution result.

2. The task execution method according to claim 1, characterized in that: Also includes: Obtaining the task status of the task to be executed; The task status is displayed on a first visual interface.

3. The task execution method according to claim 1, characterized in that: The allocating the executable resource corresponding to the target resource type from the executable resources to the task to be executed according to the priority level includes: determining the number of executable resources of each of the resource types; When the quantity meets a preset condition, the executable resource corresponding to the target resource type is allocated to the task to be executed from the executable resources according to the priority.

4. The task execution method according to claim 1, characterized in that: The allocating the executable resource corresponding to the target resource type to the task to be executed from the executable resources according to the priority level includes: Acquire tree data, where nodes of the tree data are attribute information; Determine the priority between the tasks to be executed based on the node order of the attribute information of each task to be executed in the tree data, and obtain the target task with the highest priority; Corresponding executable resources are allocated to the target task from the executable resources.

5. The task execution method according to claim 1, characterized in that: The allocating the executable resource corresponding to the target resource type from the executable resources to the task to be executed according to the priority level includes: Filter out target tasks whose target resource type is a specific type; sorting the target tasks according to the priorities corresponding to the attribute information of the target tasks; Corresponding executable resources are allocated to the target tasks in the order of the sorting.

6. The task execution method according to claim 1, characterized in that: Also includes: Displaying a second visual interface, wherein each task to be executed is displayed in order of priority; Receive modification operations from users; The order of each of the tasks to be executed is adjusted based on the modification operation.

7. The task execution method according to claim 2, characterized in that: The task status includes pending, executing, task completed, and also includes: Obtaining the executed tasks whose task status is task completed; A task report is generated based on the execution information of the executed task, and the task report is displayed.

8. A task execution device, characterized in that: include: A task acquisition module, used to acquire tasks to be executed and extract attribute information of the tasks to be executed; A task grouping module, used to determine the resource grouping and priority of the task to be executed according to the attribute information; A resource determination module, used to determine the target resource type required for the task to be executed according to the resource grouping; A resource allocation module, used for acquiring executable resources of various resource types, and allocating executable resources corresponding to the target resource type to the task to be executed from the executable resources according to the priority; The task execution module is used to execute the to-be-executed task based on the allocated executable resources to obtain a task execution result. 9 . A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the task execution method according to claim 1 .

10. An electronic device, characterized in that: It comprises a processor and a memory, wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the task execution method described in any one of claims 1 to 7.