Method and device for processing computing task, medium and program product
By selecting matching target services according to task types in the distributed computing system to execute computing tasks, it solves the scheduling performance bottleneck and resource waste problems of Kubernetes in processing massive computing tasks, and improves resource utilization and task management efficiency.
Patent Information
- Application Number
- CN202410732922.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-24
AI Technical Summary
Kubernetes has scheduling performance bottlenecks when processing massive computing tasks. Frequent creation and destruction of resources leads to resource waste. The lack of regular resource management leads to resource fragmentation and affects resource utilization.
By selecting matching target services from multiple pre-created target services to execute tasks based on the type of tasks to be processed in the distributed computing system, Kubernetes reduces the frequency of creating and destroying physical resources, and uses multiple resident services in one Pod. Perform specific types of computing tasks on a target service, and perform only one task on a target service for easy management and monitoring.
It reduces resource waste caused by resource fragmentation and frequent creation and destruction, improves resource utilization, and simplifies the life cycle management and execution monitoring of computing tasks.
Smart Images

Figure CN118689591A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer-readable medium, and computer program product for processing computing tasks. Background Art
[0002] With the development of technologies such as big data and machine learning, as well as the explosive growth of video content and the massive increase in video processing demand, centralized computing is difficult to handle massive, large-scale computing tasks. Distributed computing allows parallel computing tasks on multiple computing nodes, improving computing efficiency and the ability to process large-scale data, while also increasing the system's fault tolerance and scalability. Today, distributed computing has been widely used in cloud computing, big data processing, machine learning, video processing and other fields.
[0003] Most distributed systems are built on Kubernetes, which uses containerization to isolate resources and deployment and orchestration to dispatch tasks. However, based on this approach, Kubernetes' scheduling capabilities face performance bottlenecks when dispatching massive computing tasks. In addition, Kubernetes frequently creates and destroys resources, resulting in resource waste, that is, computing resources do not perform real computing tasks during the creation and destruction process. In addition, irregular creation of resources of different specifications can easily lead to resource fragmentation and affect resource utilization. Summary of the invention
[0004] Various aspects of the present application provide a method, an apparatus, a computer-readable medium, and a computer program product for processing a computing task.
[0005] In one aspect of the present application, a method for processing a computing task is provided, wherein the method comprises:
[0006] In response to receiving a task to be processed, obtaining task type information of the task to be processed;
[0007] Selecting a target service matching the task type information from a plurality of pre-created target services;
[0008] The to-be-processed task is sent to a working node where a target service matching the task type information is located for processing.
[0009] In one aspect of the present application, a device for processing a computing task is provided, wherein the device comprises:
[0010] means for acquiring task type information of the task to be processed in response to receiving the task to be processed;
[0011] A device for selecting a target service matching the task type information from a plurality of pre-created target services, wherein the target service is included in a working node of a distributed container orchestration management cluster;
[0012] A device for sending the to-be-processed task to a working node where a target service matching the task type information is located for processing.
[0013] Another aspect of the present application provides an electronic device, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of the embodiment of the application.
[0017] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method of the embodiment of the application.
[0018] Another aspect of the present application provides a computer program product, including a computer program, which implements the method of the embodiment of the application when executed by a processor.
[0019] The solution provided in the embodiment of the present application selects a target service that matches the task type from multiple pre-established target services to execute the task in a distributed computing system based on the type of task to be processed. This method changes the traditional Kubernetes method of running a single task at a time in a Pod to running multiple resident services on each Pod to execute a specific type of computing task, and a Pod receives multiple tasks for execution, thereby reducing the frequency of Kubernetes creating and destroying physical resources, reducing resource fragmentation, and reducing resource waste caused by frequent creation and destruction of physical resources. According to the embodiment of the present application, only one task is executed on a target service at the same time, which facilitates the management of the life cycle of computing tasks and the monitoring of task execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0022] Figure 1 A schematic diagram of a process for processing a computing task provided by an embodiment of the present application is shown;
[0023] Figure 2 An exemplary system architecture diagram according to an embodiment of the present application is shown;
[0024] Figure 3 A schematic diagram of an exemplary Kubernetes cluster according to an embodiment of the present application is shown;
[0025] Figure 4 A schematic diagram of the structure of a device for processing a computing task provided by an embodiment of the present application is shown;
[0026] Figure 5 A schematic diagram of the structure of a device suitable for implementing the solution in the embodiment of the present application is shown.
[0027] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPU), input / output interface, network interface and memory.
[0030] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0031] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0032] The following is an explanation of the terms involved in the embodiments of the present application.
[0033] Distributed system: A system consisting of multiple computer nodes that are interconnected through a network and work together to complete a task or service.
[0034] Kubernetes: Kubernetes refers to the container cluster management system. It is an open source container orchestration platform for automating the deployment, expansion and management of containerized applications. Kubernetes groups the containers that make up the application into logical units for easy management and discovery. Kubernetes can manage multiple containerized applications and provide load balancing, automatic scaling, automatic recovery and other functions, making the deployment and management of containerized applications simpler and more efficient.
[0035] Pod: Pod refers to a container unit. Kubernetes' Pod is the smallest deployable unit in Kubernetes. A Pod is a collection of one or more containers that run on the same node and share network and storage resources. Containers in a Pod can share the same network namespace, so they can communicate using localhost, or they can share the same storage volume to share data. A Pod can also be viewed as a logical host with its own IP address and port. It can communicate between containers internally, and can also be exposed to the outside world through a Kubernetes Service to access the Pod.
[0036] Sidecar: A design pattern that is loosely coupled with the main application but shares the same lifecycle and resources, such as network and storage. Sidecar containers are often used to perform tasks that are related to the main application but independent of it, such as log collection, configuration updates, network proxies, etc.
[0037] DAG (Directed Acyclic Graph): It is a graph data structure consisting of nodes (vertices) and edges (directed arrows) connecting these nodes. In DAG, each edge has a direction, pointing from one node to another, but does not form any closed loop, that is, starting from any node and moving along the direction of the edge, it is impossible to return to the starting point.
[0038] Figure 1 A flow chart of a method for processing a computing task provided by an embodiment of the present application is shown. The method at least includes step S101, step S102 and step S103.
[0039] In actual scenarios, the execution subject of the above method can be any one or more nodes in a distributed computing system. The specific implementation of the node may include a user device, a network device, or a device formed by integrating a user device and a network device through a network, and may also be a program running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, and tablet computers. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or computer sets based on cloud computing. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0040] Among them, the computing resources of the embodiments of the present application include but are not limited to a central processing unit (CPU) or a graphics processing unit (GPU).
[0041] In the scenario of processing video manuscripts, the method according to this embodiment can be executed by a server for scheduling resources, which interacts with each computing resource in a computing resource cluster through a network connection. Among them, the method grades the computing resources according to the priority of the video manuscript to be processed, thereby dividing the computing resources into multiple clusters corresponding to different priorities. The server can collect the usage of computing resources in each cluster in real time, and dynamically adjust the computing resource configuration in clusters of various levels based on the collected information. Among them, the computing resources of the embodiment of the present application are deployed using containers. The computing resources can be a Pod composed of one or more containers. Pod is the smallest scheduling unit in Kubernetes, and the containers in the Pod share network and storage resources.
[0042] Kubernetes resources (such as CPU or GPU) are physically isolated, that is, resources occupied by one computing task cannot be used by other computing tasks. Based on the traditional Kubernetes solution, for the computing tasks to be processed, the scheduling service selects the physical node and uses virtualization technology to isolate resources according to the resource requirements of the computing task, that is, to pull up the Pod. After the computing task is executed, the Pod is destroyed to release the resources.
[0043] Different from this process, in the embodiment of the present application, for the computing task to be processed, the scheduling service selects a matching target service from multiple target services contained in the pre-created working node based on resource requirements and the type of computing task to execute the computing task. In addition, the embodiment of the present application dynamically adjusts the number of created working nodes according to the system load. An exemplary architecture of the embodiment of the present application is as follows: Figure 2 See Figure 2 , the architecture includes a Kubernetes cluster including node 1 and node 2, and node 1 and node 2 correspond to a Pod of Kubernetes respectively. Node 1 and node 2 respectively include multiple target services, and the target services correspond to specific computing task types. The API Server serves as the gateway of the Kubernetes cluster. Other devices access the cluster through the API Server and use the API Server as a proxy or channel to access nodes and Pods.
[0044] According to an embodiment of the present application, a distributed container orchestration management cluster includes multiple working nodes, and each working node includes multiple target services for executing computing tasks.
[0045] exist Figure 1 Before the step of, the method further includes step S104.
[0046] In step S104, a distributed container orchestration management cluster is created.
[0047] The cluster includes multiple working nodes, and each working node includes multiple target services for executing computing tasks.
[0048] The target services correspond to specific computing task types respectively. Each target service included in each working node can execute the same or different types of computing tasks.
[0049] Optionally, after each working node or the target service on the working node is created, the method marks the type of tasks that can be executed by the working node, so that the working node or the target service on the working node is used to execute computing tasks of the marked type.
[0050] It should be noted that the same computing task type has the same corresponding resource requirements. For example, in the video processing scenario, for different types of video processing tasks such as "adding watermarks", "video screenshots", or "video frame extraction", the corresponding resource requirements are the same.
[0051] The target service includes resource logic attribute information. The number of target services that can be run on each working node is determined by the logical resource attribute.
[0052] For example, a worker node with 8 CPU cores can run 8x1CPU resident services, or 2x1CPU+3x2CPU resident services.
[0053] According to one embodiment, the distributed container orchestration management cluster created by the embodiment of the present application is a Kubernetes cluster, which includes multiple working nodes, each working node corresponds to a Pod of a Kubernetes, and the Pod includes a main container and a companion container.
[0054] According to the first example of this application, referring to Figure 3 As shown, the created Kubernetes cluster includes a scheduling service and multiple worker nodes. Each worker node corresponds to a Pod of Kubernetes. Each worker node contains multiple resident services.
[0055] Refer to the following Figure 1 To illustrate, in step S101, in response to receiving a task to be processed, task type information of the task to be processed is obtained.
[0056] The tasks to be processed may include various types of tasks that require computing resources to process. In the video processing scenario, the tasks to be processed are video manuscripts to be processed.
[0057] In step S102, a target service matching the task type information is selected from a plurality of pre-created target services.
[0058] The target service is included in the working node of the distributed container orchestration management cluster.
[0059] According to one embodiment, the method further includes step S105.
[0060] In step S105, multiple groups of queue instances are created to manage the multiple target services, and the queue instances include idle queues and busy queues.
[0061] Specifically, the method creates and maintains target service queue instances corresponding to different task types respectively according to a plurality of preset task types.
[0062] According to this embodiment, in step S102, a target service queue that matches the task type of the task to be processed is queried from the created target service queues, and a target service for executing the task at the agent is selected from the idle queues.
[0063] Continue to refer to Figure 3 To illustrate the first example, the scheduling service maintains multiple groups of resident service queues, each of which corresponds to one of multiple preset task types. In addition, the maintained resident service queues are divided into idle queues and busy queues.
[0064] Continue to refer to Figure 3 To illustrate the first example, in response to receiving a video processing task request, the scheduling service selects a resident service that matches the task type from the idle queue according to the task type of the video processing task. Then, the video processing task is sent to the resident service, and the resident service is added to the busy queue. If the idle queue is empty, it means that there are currently no available resources to process the task.
[0065] Optionally, the method according to this embodiment further includes step S106 and step S107.
[0066] In step S106, queue length information is monitored, where the queue length information includes the lengths of idle queues and busy queues of target services corresponding to each task type.
[0067] In step S107, based on the monitored queue length information, capacity expansion or capacity reduction processing is performed when a predetermined capacity expansion condition or capacity reduction condition is met.
[0068] Those skilled in the art should be familiar with the fact that the expansion condition or reduction condition can be set based on a variety of methods, for example, when the length of a busy queue is greater than a predetermined threshold, it is determined that the expansion condition is met; for example, when the length of an idle queue is greater than a predetermined threshold, it is determined that the reduction condition is met, etc., which will not be repeated here.
[0069] According to one embodiment, the capacity expansion process or capacity reduction process includes increasing or decreasing the number of working nodes of the corresponding task type.
[0070] Specifically, based on the monitored queue length information, determine whether the queue corresponding to each character type meets the predetermined expansion or reduction conditions; if the queue length information corresponding to a certain task type meets the predetermined expansion or reduction conditions, the current working node corresponding to the task type is expanded or reduced.
[0071] According to this embodiment, if capacity expansion is required, a working node is added to the cluster, and a target task corresponding to the task type that needs to be expanded is created in the new working node; if capacity reduction is required, the traffic on the working node to be reduced is first removed, and after waiting for all target services on the working node to be idle, the container resources corresponding to the target node are destroyed.
[0072] Optionally, the expansion or reduction process may further include increasing or decreasing the number of target services of the corresponding task type. The method of increasing or decreasing the number of target services is similar to the above-mentioned method of increasing or decreasing the number of working nodes, which will not be repeated here.
[0073] Continue to refer to Figure 1 To illustrate, in step S103, the task to be processed is sent to a working node where a target service matching the task type information is located for processing.
[0074] According to one embodiment, there is only one task executed on the target service at the same time, and the method further includes step S108.
[0075] In step S108, monitoring and management processing is performed on the target services of each execution task.
[0076] The monitoring management process includes but is not limited to at least one of the following processing operations:
[0077] 1) Manage the life cycle of execution tasks;
[0078] 2) Monitor the situation during task execution; for example, monitor the task execution results, detect whether there are any abnormalities in task execution, etc.
[0079] Continue to refer to Figure 3 To illustrate the first example, each resident service executes only one task at a time, manages the task life cycle and captures exceptions that occur during the execution of the task. In addition, each resident service corresponds to a specific computing task type.
[0080] Since the same large task process may contain more sub-processes, each sub-process requires different numbers of resources, and the next sub-process may require the response value of the previous sub-process, by creating multiple resident services of different specifications corresponding to different computing task types on the same working node, the overhead of data transmission between different sub-processes of the same task can be avoided.
[0081] Optionally, the method according to this embodiment also includes step S109.
[0082] In step S109, based on the monitored task execution result, if the execution result is successful, the target service that has completed the execution task will be added to the idle queue corresponding to the task type, waiting for the next task request; if the execution result is failed, a retry is triggered and an alarm notification is issued.
[0083] The method further includes step S110.
[0084] In step S110, if it is monitored that the working node or the target service included in the working node is dead or abnormal, a retry is performed and / or an alarm notification is issued accordingly.
[0085] Optionally, if the task execution result returned by the target service is not received, it is determined that the target service died during the task execution process.
[0086] Optionally, since only one task is executed on each target service at the same time, the unique ID of the task being executed by the target service is recorded before the target service joins the busy queue. When a target service dies or is abnormal, the task information is obtained based on the recorded task unique ID to perform retries and alarm notifications.
[0087] If the entire working node dies, the task information corresponding to all target services in the busy queue on the working node is obtained to perform retries and issue an alarm notification.
[0088] According to one embodiment, for a task to be processed that includes multiple subtasks, the method further includes step S111 and step S112.
[0089] In step S111, based on the processes of the multiple subtasks included in the task to be processed, a directed acyclic graph (DAG) of each subtask is generated.
[0090] In step S112, the task issuing order of each sub-process is determined according to the generated directed acyclic graph structure, so that the tasks to be processed are issued according to the issuing order.
[0091] According to the method of the embodiment of the present application, in a distributed computing system, based on the type of task to be processed, a target service matching the task type is selected from multiple pre-established target services to execute the task. This method changes the traditional Kubernetes method of running a single task at a time in a Pod to running multiple resident services on each Pod to execute specific types of computing tasks, and a Pod receives multiple tasks for execution, reducing the frequency of Kubernetes creating and destroying physical resources, reducing resource fragmentation, and reducing resource waste caused by frequent creation and destruction of physical resources. According to the embodiment of the present application, only one task is executed on a target service at the same time, which facilitates the management of the life cycle of computing tasks and the monitoring of task execution.
[0092] In addition, the present application also provides a device for processing computing tasks, the structure of which is as follows: Figure 4 shown.
[0093] The device includes: a device for obtaining task type information of the task to be processed in response to receiving the task to be processed (hereinafter referred to as "type obtaining device 101"), a device for selecting a target service matching the task type information from a plurality of pre-created target services (hereinafter referred to as "service determining device 102"), and a device for sending the task to be processed to a working node where the target service matching the task type information is located for processing (hereinafter referred to as "task sending device 103").
[0094] The device also includes a cluster creation device.
[0095] exist Figure 4 Prior to the operation of the apparatus shown, the cluster creation apparatus creates a distributed container orchestration management cluster.
[0096] The cluster includes multiple working nodes, and each working node includes multiple target services for executing computing tasks.
[0097] The target services correspond to specific computing task types respectively. Each target service included in each working node can execute the same or different types of computing tasks.
[0098] Optionally, after each working node or the target service on the working node is created, the method marks the type of tasks that can be executed by the working node, so that the working node or the target service on the working node is used to execute computing tasks of the marked type.
[0099] It should be noted that the same computing task type has the same corresponding resource requirements. For example, in the video processing scenario, for different types of video processing tasks such as "adding watermarks", "video screenshots", or "video frame extraction", the corresponding resource requirements are the same.
[0100] The target service includes resource logic attribute information. The number of target services that can be run on each working node is determined by the logical resource attribute.
[0101] For example, a worker node with 8 CPU cores can run 8x1CPU resident services, or 2x1CPU+3x2CPU resident services.
[0102] According to one embodiment, the distributed container orchestration management cluster created by the embodiment of the present application is a Kubernetes cluster, which includes multiple working nodes, each working node corresponds to a Pod of a Kubernetes, and the Pod includes a main container and a companion container.
[0103] According to the first example of this application, referring to Figure 3 As shown, the created Kubernetes cluster includes a scheduling service and multiple worker nodes. Each worker node corresponds to a Pod of Kubernetes. Each worker node contains multiple resident services.
[0104] Refer to the following Figure 4 To explain, the type acquisition means 101 acquires the task type information of the task to be processed in response to receiving the task to be processed.
[0105] The tasks to be processed may include various types of tasks that require computing resources to process. In the video processing scenario, the tasks to be processed are video manuscripts to be processed.
[0106] The service determining means 102 selects a target service matching the task type information from a plurality of pre-created target services.
[0107] The target service is included in the working node of the distributed container orchestration management cluster.
[0108] According to one embodiment, the device further comprises a queue management device.
[0109] The queue management device creates multiple groups of queue instances to manage the multiple target services, and the queue instances include idle queues and busy queues.
[0110] Specifically, the queue management device creates and maintains target service queue instances corresponding to different task types according to a plurality of preset task types.
[0111] According to this embodiment, the service determining means 102 searches the created target service queues for a target service queue that matches the task type of the task to be processed, and selects a target service for executing the task at the agent from the idle queues.
[0112] Continue to refer to Figure 3 To illustrate the first example, the scheduling service maintains multiple groups of resident service queues, each of which corresponds to one of multiple preset task types. In addition, the maintained resident service queues are divided into idle queues and busy queues.
[0113] Continue to refer to Figure 3 To illustrate the first example, in response to receiving a video processing task request, the scheduling service selects a resident service that matches the task type from the idle queue according to the task type of the video processing task. Then, the video processing task is sent to the resident service, and the resident service is added to the busy queue. If the idle queue is empty, it means that there are currently no available resources to process the task.
[0114] Optionally, the device according to this embodiment further includes a queue monitoring device and a capacity expansion and contraction device.
[0115] The queue monitoring device monitors queue length information, where the queue length information includes the lengths of idle queues and busy queues of target services corresponding to each task type.
[0116] The expansion and contraction device performs expansion processing or contraction processing based on the monitored queue length information when a predetermined expansion condition or contraction condition is met.
[0117] Those skilled in the art should be familiar with the fact that the expansion condition or reduction condition can be set based on a variety of methods, for example, when the length of a busy queue is greater than a predetermined threshold, it is determined that the expansion condition is met; for example, when the length of an idle queue is greater than a predetermined threshold, it is determined that the reduction condition is met, etc., which will not be repeated here.
[0118] According to one embodiment, the capacity expansion process or capacity reduction process includes increasing or decreasing the number of working nodes of the corresponding task type.
[0119] Specifically, the expansion and contraction device determines whether the queues corresponding to each character type meet predetermined expansion conditions or contraction conditions based on the monitored queue length information; if the queue length information corresponding to a certain task type meets the predetermined expansion conditions or contraction conditions, the expansion and contraction device expands or contracts the current working node corresponding to the task type.
[0120] According to this embodiment, if capacity expansion is required, the capacity expansion and contraction device adds a working node in the cluster and creates a target task corresponding to the task type that needs to be expanded in the new working node; if capacity reduction is required, the capacity expansion and contraction device first removes the traffic on the working node to be reduced, and waits until all target services on the working node are idle, and then destroys the container resources corresponding to the target node.
[0121] Optionally, the expansion or reduction process may further include increasing or decreasing the number of target services of the corresponding task type. The expansion or reduction device increases or decreases the number of target services in a manner similar to the above-mentioned manner of increasing or decreasing the number of working nodes, which will not be repeated here.
[0122] Continue to refer to Figure 4 To illustrate, the task issuing device 103 issues the to-be-processed task to a working node where a target service matching the task type information is located for processing.
[0123] According to one embodiment, there is only one task executed on the target service at the same time, and the method further includes executing a monitoring device.
[0124] The execution monitoring device monitors and manages the target services of each execution task.
[0125] The monitoring management process includes but is not limited to at least one of the following processing operations:
[0126] 1) Manage the life cycle of execution tasks;
[0127] 2) Monitor the situation during task execution; for example, monitor the task execution results, detect whether there are any abnormalities in task execution, etc.
[0128] Continue to refer to Figure 3 To illustrate the first example, each resident service executes only one task at a time, manages the task life cycle and captures exceptions that occur during the execution of the task. In addition, each resident service corresponds to a specific computing task type.
[0129] Since the same large task process may contain more sub-processes, each sub-process requires different numbers of resources, and the next sub-process may require the response value of the previous sub-process, by creating multiple resident services of different specifications corresponding to different computing task types on the same working node, the overhead of data transmission between different sub-processes of the same task can be avoided.
[0130] Optionally, the device according to this embodiment further includes a result processing device.
[0131] Based on the monitored task execution results, if the execution result is successful, the result processing device will add the target service that completes the execution task to the idle queue corresponding to the task type, waiting for the next task request; if the execution result is failed, the result processing device will trigger a retry and issue an alarm notification.
[0132] Wherein, the device also includes a step exception processing device.
[0133] If it is monitored that the working node or the target service included in the working node dies or an exception occurs, the exception handling device will perform a retry and / or issue an alarm notification accordingly.
[0134] Optionally, if the task execution result returned by the target service is not received, the exception handling device determines that the target service died during the task execution process.
[0135] Optionally, since only one task is executed on each target service at the same time, the unique ID of the task being executed by the target service is recorded before the target service joins the busy queue. When a target service dies or is abnormal, the task information is obtained based on the recorded task unique ID to perform retries and alarm notifications.
[0136] If the entire working node dies, the exception handling device obtains the task information corresponding to all target services in the busy queue on the working node to perform a retry and issue an alarm notification.
[0137] According to one embodiment, for a task to be processed that includes multiple subtasks, the device further includes a DAG generating device and an order determining device.
[0138] The DAG generating device generates a directed acyclic graph (DAG) of each subtask based on the processes of the multiple subtasks included in the task to be processed.
[0139] The sequence determination device determines the task delivery sequence of each sub-process according to the generated directed acyclic graph structure, thereby delivering the tasks to be processed according to the delivery sequence.
[0140] According to the device of the embodiment of the present application, in a distributed computing system, based on the type of task to be processed, a target service matching the task type is selected from multiple pre-established target services to execute the task. This method changes the traditional Kubernetes method of running a single task at a time in a Pod to running multiple resident services on each Pod to execute a specific type of computing task, and a Pod receives multiple tasks for execution, reducing the frequency of Kubernetes creating and destroying physical resources, reducing resource fragmentation, and reducing resource waste caused by frequent creation and destruction of physical resources. According to the embodiment of the present application, only one task is executed on a target service at the same time, which facilitates the management of the life cycle of computing tasks and the monitoring of task execution.
[0141] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, and the method corresponding to the electronic device may be the method for processing computing tasks in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0142] The electronic device may be a user device, or a device formed by integrating a user device and a network device through a network, or may be an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0143] Figure 5The structure of a device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown, and the device 1200 includes a central processing unit (CPU, Central Processing Unit) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM, Random Access Memory) 1203. In RAM1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through bus 1204. Input / output (I / O, Input / Output) interface 1205 is also connected to bus 1204.
[0144] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; a storage section 1208 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet.
[0145] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, the above functions defined in the method of the present application are executed.
[0146] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application described above.
[0147] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. 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 thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: 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 thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device, or device.
[0148] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals 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 a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0149] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0150] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0151] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0152] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0153] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0154] 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 network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0155] 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 hardware plus software functional units.
[0156] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0158] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for processing a computing task, wherein: The method comprises: In response to receiving a task to be processed, obtaining task type information of the task to be processed; Selecting a target service matching the task type information from a plurality of pre-created target services, wherein the target service is included in a working node of a distributed container orchestration management cluster; The to-be-processed task is sent to a working node where a target service matching the task type information is located for processing.
2. The claim according to claim 1, wherein: The method further comprises: A distributed container orchestration management cluster is created, wherein the cluster includes multiple working nodes, and each working node includes multiple target services for executing computing tasks.
3. The claim according to claim 1 or 2, wherein: The method further comprises: A plurality of groups of queue instances are created to manage the plurality of target services, wherein the queue instances include idle queues and busy queues.
4. The method according to claim 3, wherein: The method further comprises: Monitoring queue length information, the queue length information including lengths of idle queues and busy queues of target services corresponding to respective task types; Based on the monitored queue length information, expansion processing or capacity reduction processing is performed when a predetermined expansion condition or capacity reduction condition is met.
5. The claim according to claim 3, wherein: The method further comprises: Monitor and manage the target services of each execution task.
6. The method according to claim 5, wherein: The monitoring management process includes monitoring the task execution results, and the method further includes: Based on the monitored task execution results, if the execution result is successful, the target service that has completed the execution task will be added to the idle queue corresponding to the task type, waiting for the next task request. If the execution result is a failure, a retry is triggered and an alarm notification is issued.
7. The method according to claim 5 or 6, wherein: The method further comprises: If it is detected that the working node or the target service contained in the working node dies or an exception occurs, a retry and / or an alarm notification is performed accordingly.
8. The claim according to claim 1 or 2, wherein: The method further comprises: Based on the processes of the multiple subtasks of the computing task, generating a directed acyclic graph of each of the subtasks; The task issuing order of each sub-process is determined according to the generated directed acyclic graph structure, so that the tasks to be processed are issued according to the issuing order.
9. A device for processing a computing task, wherein: The device comprises: means for acquiring task type information of the task to be processed in response to receiving the task to be processed; A device for selecting a target service matching the task type information from a plurality of pre-created target services, wherein the target service is included in a working node of a distributed container orchestration management cluster; A device for sending the to-be-processed task to a working node where a target service matching the task type information is located for processing.
10. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. A computer readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Computing task execution method and device, equipment and storage medium
CN120011026A
DataX distributed data synchronization method and device based on Kubernetes and electronic equipment
CN120470060A
