Task management method and device, electronic equipment, network system and storage medium

By implementing task management methods on terminal devices, using the task pool and virtual machines of the computing container to allocate and schedule tasks according to resource conditions, the task resource management problems on terminal devices are solved, and task execution efficiency and equipment performance are improved.

CN119105854APending Publication Date: 2024-12-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411281061.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

There is no computing container on the terminal device, which makes it difficult for tasks to effectively manage the resources required for computing tasks. Resource competition and conflict lead to performance degradation and tasks cannot be executed normally.

Method used

Provide a task management method, extract tasks to be executed through the task pool of the computing container, allocate computing resources according to the resource situation, use the virtual machine to execute tasks, and move tasks to candidate queues when resources are insufficient, and scheduling according to priority level to realize resources rational allocation and effective utilization.

Benefits of technology

It improves the efficiency of task execution, ensures the rational allocation and effective utilization of resources, avoids resource competition and conflicts, and improves the performance of terminal equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105854A_ABST
    Figure CN119105854A_ABST
Patent Text Reader

Abstract

The invention provides a task management method and device, electronic equipment, a network system and a storage medium, and relates to the technical field of computers. The task management method comprises the steps of extracting a to-be-executed task corresponding to a task identifier from a task pool of a computing container according to the received task identifier; under the condition that the computing resource required by the to-be-executed task is smaller than or equal to the current idle computing resource of the computing container, allocating the required computing resource to the to-be-executed task; and executing the to-be-executed task by utilizing the virtual machine in the computing container.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a task management method and device, an electronic device, a network system, and a storage medium. Background Art

[0002] At present, with the increase in chip computing power of terminal devices, it has become feasible to perform complex AI (Artificial Intelligence) computing tasks on terminal devices. In this context, edge computing has emerged and has become a focus in the field of information technology. Edge devices are closer to the source of data and the consumers of computing results, so more and more AI computing tasks are migrated from the cloud to edge devices for execution. Summary of the invention

[0003] The inventors noticed that in the related art, the terminal device does not have a computing container, so it is difficult for the tasks on the terminal device to effectively manage the resources required for the computing tasks. Resource competition and conflicts may occur between different tasks, resulting in a decline in the performance of the terminal device and the inability to execute tasks normally.

[0004] Accordingly, the present disclosure provides a task management method that can ensure the reasonable allocation and effective utilization of resources and improve the execution efficiency of tasks.

[0005] According to a first aspect of an embodiment of the present disclosure, a task management method is provided, which is executed by a task management device, including: extracting a to-be-executed task corresponding to the task identifier from a task pool of a computing container based on a received task identifier; allocating required computing resources to the to-be-executed task when the computing resources required for the to-be-executed task are less than or equal to the current idle computing resources of the computing container; and executing the to-be-executed task using a virtual machine in the computing container.

[0006] In some embodiments, when the computing resources required by the task to be executed are greater than the current idle computing resources of the computing container, the task to be executed is moved as a candidate task to a candidate queue of the computing container.

[0007] In some embodiments, executing the task to be executed includes: moving the task to be executed to the task processing queue of the computing container; determining whether the task processing queue only includes the task to be executed; and when the task processing queue only includes the task to be executed, executing the task to be executed using the virtual machine.

[0008] In some embodiments, executing the to-be-executed task includes: when the task processing queue includes multiple tasks, using the virtual machine to execute the multiple tasks in sequence in order of task priority from high to low.

[0009] In some embodiments, when the virtual machine completes the currently executed task, the computing resources allocated to the currently executed task are released.

[0010] In some embodiments, when the computing resources allocated to the currently executed task are released, it is determined whether the candidate queue of the computing container includes the candidate task; when the candidate task is included in the candidate queue, based on the task priority of the candidate task, a task whose required computing resources are less than the currently idle computing resources of the computing container is selected from the candidate tasks; the required computing resources are allocated to the selected task, and the selected task is moved into the task processing queue.

[0011] In some embodiments, when the computing resources allocated to the task to be executed are released, it is determined whether the candidate queue of the computing container includes the candidate task; when the candidate task is included in the candidate queue, based on the task priority of the candidate task, a task whose required computing resources are less than the current idle computing resources of the computing container is selected from the candidate tasks to be moved to the task processing queue.

[0012] In some embodiments, during the process of executing tasks using the virtual machine, if a recoverable exception occurs in the computing container, the tasks in the task pool are recovered; and execution failure information of the tasks to be executed is reported.

[0013] In some embodiments, during the process of executing a task using the virtual machine, if an unrecoverable exception occurs in the computing container, the computing container is restarted.

[0014] In some embodiments, when an updated version of a specified task exists, the updated version of the specified task is obtained from a server; the current version of the specified task in the task pool is deleted; and the updated version of the specified task is stored in the task pool.

[0015] In some embodiments, the tasks downloaded from the server are stored in the task pool.

[0016] According to a second aspect of an embodiment of the present disclosure, a task management device is provided, comprising: an extraction module, configured to extract a to-be-executed task corresponding to a task identifier from a task pool of a computing container based on a received task identifier; a resource allocation module, configured to allocate required computing resources to the to-be-executed task if the computing resources required for the to-be-executed task are less than the current idle computing resources of the computing container; and a task execution module, configured to execute the to-be-executed task using a virtual machine in the computing container.

[0017] According to a third aspect of an embodiment of the present disclosure, there is provided a task management device, comprising: a memory; a processor, coupled to the memory, the processor being configured to execute a method as described in any of the above embodiments based on instructions stored in the memory.

[0018] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a task management device as described in any of the above embodiments.

[0019] In some embodiments, the electronic device further comprises: an interaction device configured to send a first request to a server, and send a task corresponding to the first request sent by the server to the task management device.

[0020] In some embodiments, the interaction device is configured to send a second request to the server according to the version update information of the designated task sent by the server, and send the updated version of the designated task sent by the server to the task management device.

[0021] According to a fifth aspect of an embodiment of the present disclosure, a network system is provided, comprising: an electronic device as described in any of the above embodiments; a task publishing device, configured to publish tasks; and a server, configured to store tasks published by the task publishing device, and according to a first request sent by the electronic device, send a task corresponding to the first request to the electronic device.

[0022] In some embodiments, the server is configured to send version update information of the specified task to the electronic device if an updated version of the specified task exists, and send the updated version of the specified task to the electronic device according to a second request sent by the electronic device.

[0023] According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the method involved in any of the above embodiments is implemented.

[0024] According to a seventh aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, the method involved in any of the above embodiments is implemented.

[0025] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0027] Figure 1 A schematic diagram of the structure of a computing container according to an embodiment of the present disclosure;

[0028] Figure 2 A flowchart of a task management method according to an embodiment of the present disclosure;

[0029] Figure 3 A flowchart of a task management method according to another embodiment of the present disclosure;

[0030] Figure 4 A flowchart of a task management method according to another embodiment of the present disclosure;

[0031] Figure 5 A schematic diagram of the structure of a task management device according to an embodiment of the present disclosure;

[0032] Figure 6 A schematic diagram of the structure of a task management device according to another embodiment of the present disclosure;

[0033] Figure 7 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure;

[0034] Figure 8 A schematic diagram of the structure of an electronic device according to another embodiment of the present disclosure;

[0035] Fig. 9 A schematic diagram of the structure of a network system according to an embodiment of the present disclosure;

[0036] Fig.10 A schematic diagram of the structure of a network system according to another embodiment of the present disclosure. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0038] The relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.

[0039] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0040] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.

[0041] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0042] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0043] Figure 1 FIG. 1 is a schematic diagram of the structure of a computing container according to an embodiment of the present disclosure. Figure 1 As shown, a task pool 11, a task processing queue 12, a candidate queue 13 and a virtual machine 14 are provided in the computing container 10. The virtual machine 14 includes a system basic library 141, a data processing module 142, a computing engine 143 and a log system 144. For example, the virtual machine 14 is a Python virtual machine.

[0044] The task pool 11 is used to store tasks downloaded from the server. When task A needs to be executed, if the current idle resources of the computing container can meet the computing resources required by task A, task A is moved from the task pool 11 to the task processing queue 12, and the virtual machine 14 executes the tasks in the task processing queue 12. If the current idle resources of the computing container cannot meet the computing resources required by task A, task A is moved from the task pool 11 to the candidate queue 13. When the resource conditions are met, task A is moved from the candidate queue 13 to the task processing queue 12 so that the virtual machine 14 can execute task A.

[0045] Figure 2 The following is a flow chart of a task management method according to an embodiment of the present disclosure. In some embodiments, the following task management method is executed by a task management device, including steps 21-23.

[0046] In step 21, based on the received task identifier, a to-be-executed task corresponding to the task identifier is extracted from the task pool of the computing container.

[0047] For example, during the operation of an application in an electronic device, the calculation result of task A needs to be used. In this case, the task management device extracts task A from the task pool of the computing container according to the received identifier of task A.

[0048] In some embodiments, the tasks downloaded from the server are stored in a task pool.

[0049] In step 22, when the computing resources required by the task to be executed are less than or equal to the current idle computing resources of the computing container, the required computing resources are allocated to the task to be executed.

[0050] It should be noted here that computing resources include the number of CPU cores required to perform tasks, CPU usage time, and content usage.

[0051] In some embodiments, when the computing resources required by the task to be executed are greater than the currently idle computing resources of the computing container, the task to be executed is moved as a candidate task to the candidate queue of the computing container.

[0052] For example, when task A is extracted from the task pool of the computing container, if the current idle resources of the computing container cannot meet the computing resources required by task A, task A is moved into the candidate queue.

[0053] In step 23, the task to be executed is executed using the virtual machine in the computing container.

[0054] In some embodiments, the task to be executed is moved to the task processing queue of the computing container, and it is determined whether the task processing queue only includes the task to be executed. If the task processing queue only includes the task to be executed, the task to be executed is executed using a virtual machine.

[0055] When a task processing queue includes multiple tasks, the multiple tasks are executed in sequence using a virtual machine in order of task priority from high to low.

[0056] For example, after task A is moved into the task processing queue, if the task processing queue only includes task A, task A is executed by using the virtual machine.

[0057] For another example, after task A is moved into the task processing queue, if the task processing queue includes task B and task C in addition to task A, and the task priority of task B is higher than the task priority of task A, and the task priority of task C is lower than the task priority of task A, in this case, the virtual machine executes task B, task A and task C in sequence.

[0058] In some embodiments, when the virtual machine completes the currently executed task, the computing resources allocated to the currently executed task are released.

[0059] It should be noted here that after each task is completed, the computing resources allocated to the task will be released so that the released resources can be allocated to other tasks, thereby effectively improving the utilization of computing resources.

[0060] In some embodiments, when releasing the computing resources allocated to the completed task, it is determined whether the candidate task is included in the candidate queue of the computing container. When the candidate task is included in the candidate queue, a task whose required computing resources are less than the current idle computing resources of the computing container is selected from the candidate tasks according to the task priority of the candidate task, the required computing resources are allocated to the selected task, and the selected task is moved into the task processing queue.

[0061] For example, when the virtual machine completes task A, the computing resources allocated to task A are released. At this time, the candidate queue includes tasks B, C, and D. The computing resources required by task B and task C are both less than the current idle computing resources of the computing container, the computing resources required by task D are greater than the current idle computing resources of the computing container, and the task priority of task C is higher than the task priority of task B. In this case, computing resources are allocated to task C, and task C is moved into the task processing queue.

[0062] In the task management method provided by the above embodiment of the present disclosure, when the computing resources required by the task to be executed are greater than the current idle computing resources of the computing container, the task to be executed is moved as a candidate task to the candidate queue of the computing container. When the computing resources required by the task to be executed are less than or equal to the current idle computing resources of the computing container, the required computing resources are allocated to the task to be executed, and the task to be executed is moved into the task processing queue so that the virtual machine of the computing container executes the task with the highest task priority in the task processing queue. After the currently executed task is completed, the computing resources of the completed task are released so that the task in the candidate queue that meets the computing resources and has the highest task priority is moved into the task processing queue so that the virtual machine of the computing container continues to execute the task. Through the above processing, it is possible to ensure the reasonable allocation and effective utilization of resources and improve the execution efficiency of tasks.

[0063] Figure 3 This is a flowchart of a task management method according to another embodiment of the present disclosure. In some embodiments, the following task management method is executed by a task management device, including steps 31-35.

[0064] In step 31, during the process of executing tasks using the virtual machine, it is determined whether an abnormality occurs in the computing container.

[0065] If the exception that occurs in the computing container is a recoverable exception, execute step 32. If the exception that occurs in the computing container is an unrecoverable exception, execute step 34. If no exception occurs in the computing container, end this process.

[0066] In step 32, tasks in the task pool are recycled.

[0067] In step 33, the execution failure information of the task to be executed is reported.

[0068] It should be noted here that recoverable exceptions refer to exceptions that do not affect the overall stability of the virtual machine. When such an exception occurs, the captured exception information is transmitted back to the server through the log system, and the task that triggered the exception is terminated.

[0069] At step 34, the compute container is restarted.

[0070] It should be noted here that an unrecoverable exception refers to a serious exception that endangers the stability of the virtual machine. In this case, the computing container will immediately terminate all running tasks, stop the execution of the virtual machine, release all computing container resources, and then restart the virtual machine. During this process, the relevant exception information will be sent back to the server through the log system.

[0071] By adopting this protection mechanism, it is possible to ensure that the computing container can maintain maximum stability and availability when facing various exceptions, while also providing maintenance personnel with the necessary information so that they can handle exceptions in a timely manner.

[0072] Figure 4 The following is a flowchart of a task management method according to another embodiment of the present disclosure. In some embodiments, the following task management method is executed by a task management device, including steps 41-43.

[0073] In step 41 , if an updated version of the specified task exists, the updated version of the specified task is obtained from the server.

[0074] For example, the task management device may query the server to obtain information about whether there is an updated version of the task currently in the task pool.

[0075] For another example, the task management device obtains information that there is an updated version of the task currently in the task pool according to the update information sent by the server.

[0076] In step 42, the current version of the specified task in the task pool is deleted.

[0077] In step 43, the updated version of the designated task is stored in the task pool.

[0078] Through the above processing, it is possible to ensure that the computing container can perform seamless hot updates on computing tasks after startup, thereby effectively achieving timely updates of task versions.

[0079] Figure 5 FIG. 1 is a schematic diagram of the structure of a task management device according to an embodiment of the present disclosure. Figure 5 As shown, the task management device includes an extraction module 51 , a resource allocation module 52 and a task execution module 53 .

[0080] The extraction module 51 is configured to extract, according to the received task identifier, the to-be-executed task corresponding to the task identifier from the task pool of the computing container.

[0081] For example, during the operation of an application in an electronic device, the calculation result of task A needs to be used. In this case, the task management device extracts task A from the task pool of the computing container according to the received identifier of task A.

[0082] In some embodiments, the tasks downloaded from the server are stored in a task pool.

[0083] The resource allocation module 52 is configured to allocate the required computing resources to the task to be executed when the computing resources required by the task to be executed are less than the current idle computing resources of the computing container.

[0084] It should be noted here that computing resources include the number of CPU cores required to perform tasks, CPU usage time, and content usage.

[0085] The task execution module 53 is configured to execute the task to be executed using the virtual machine in the computing container.

[0086] In some embodiments, the task execution module 53 moves the to-be-executed task to the task processing queue of the computing container, and determines whether the task processing queue only includes the to-be-executed task. If the task processing queue only includes the to-be-executed task, the to-be-executed task is executed using a virtual machine.

[0087] When the task processing queue includes multiple tasks, the task execution module 53 uses the virtual machine to execute the multiple tasks in sequence according to the order of task priority from high to low.

[0088] For example, after task A is moved into the task processing queue, if the task processing queue only includes task A, task A is executed by using the virtual machine.

[0089] For another example, after task A is moved into the task processing queue, if the task processing queue includes task B and task C in addition to task A, and the task priority of task B is higher than the task priority of task A, and the task priority of task C is lower than the task priority of task A, in this case, the virtual machine executes task B, task A and task C in sequence.

[0090] In some embodiments, when the virtual machine completes the currently executed task, the task execution module 53 releases the computing resources allocated to the currently executed task.

[0091] It should be noted here that after each task is completed, the computing resources allocated to the task will be released so that the released resources can be allocated to other tasks, thereby effectively improving the utilization of computing resources.

[0092] In some embodiments, when the computing resources required by the task to be executed are greater than the current idle computing resources of the computing container, the task execution module 53 moves the task to be executed as a candidate task to the candidate queue of the computing container.

[0093] For example, when task A is extracted from the task pool of the computing container, if the current idle resources of the computing container cannot meet the computing resources required by task A, task A is moved into the candidate queue.

[0094] In some embodiments, the task execution module 53 determines whether the candidate queue of the computing container includes the candidate task when releasing the computing resources allocated to the completed task. If the candidate task is included in the candidate queue, the task whose required computing resources are less than the current idle computing resources of the computing container is selected from the candidate tasks according to the task priority of the candidate task, the required computing resources are allocated to the selected task, and the selected task is moved into the task processing queue.

[0095] For example, when the virtual machine completes task A, the computing resources allocated to task A are released. At this time, the candidate queue includes tasks B, C, and D. The computing resources required by task B and task C are both less than the current idle computing resources of the computing container, the computing resources required by task D are greater than the current idle computing resources of the computing container, and the task priority of task C is higher than the task priority of task B. In this case, computing resources are allocated to task C, and task C is moved into the task processing queue.

[0096] In the task management device provided by the above embodiment of the present disclosure, when the computing resources required by the task to be executed are greater than the current idle computing resources of the computing container, the task to be executed is moved as a candidate task to the candidate queue of the computing container. When the computing resources required by the task to be executed are less than or equal to the current idle computing resources of the computing container, the required computing resources are allocated to the task to be executed, and the task to be executed is moved into the task processing queue so that the virtual machine of the computing container executes the task with the highest task priority in the task processing queue. After the currently executed task is completed, the computing resources of the completed task are released so that the task in the candidate queue that meets the computing resources and has the highest task priority can be moved into the task processing queue so that the virtual machine of the computing container can continue to execute the task. Through the above processing, it is possible to ensure the reasonable allocation and effective utilization of resources and improve the execution efficiency of tasks.

[0097] In some embodiments, the task execution module 53 determines whether an exception occurs in the computing container during the process of executing tasks using the virtual machine. If the exception occurs in the computing container is a recoverable exception, the task in the task pool is recovered and the execution failure information of the task to be executed is reported.

[0098] It should be noted here that recoverable exceptions refer to exceptions that do not affect the overall stability of the virtual machine. When such an exception occurs, the captured exception information is transmitted back to the server through the log system, and the task that triggered the exception is terminated.

[0099] In some embodiments, when the exception occurring in the computing container is an unrecoverable exception, the task execution module 53 restarts the computing container.

[0100] It should be noted here that an unrecoverable exception refers to a serious exception that endangers the stability of the virtual machine. In this case, the computing container will immediately terminate all running tasks, stop the execution of the virtual machine, release all computing container resources, and then restart the virtual machine. During this process, the relevant exception information will be sent back to the server through the log system.

[0101] By adopting this protection mechanism, it is possible to ensure that the computing container can maintain maximum stability and availability when facing various exceptions, while also providing maintenance personnel with the necessary information so that they can handle exceptions in a timely manner.

[0102] In some embodiments, if an updated version of the specified task exists, the extraction module 51 obtains the updated version of the specified task from the server, deletes the current version of the specified task in the task pool, and stores the updated version of the specified task in the task pool.

[0103] For example, the task management device may query the server to obtain information about whether there is an updated version of the task currently in the task pool.

[0104] For another example, the task management device obtains information that there is an updated version of the task currently in the task pool according to the update information sent by the server.

[0105] Through the above processing, it is possible to ensure that the computing container can perform seamless hot updates on computing tasks after startup, thereby effectively achieving timely updates of task versions.

[0106] Figure 6 This is a schematic diagram of the structure of a task management device according to another embodiment of the present disclosure.

[0107] like Figure 6 As shown in FIG. 1 , the task management device 60 is in the form of a general-purpose computing device. The task management device 60 includes a memory 61, a processor 62, and a bus 63 connecting different system components.

[0108] The memory 61 may include, for example, a system memory, a non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs. The system memory may include a volatile storage medium, such as a random access memory (RAM) and / or a cache memory. The non-volatile storage medium may store, for example, instructions of a corresponding embodiment of at least one task management method being executed. The non-volatile storage medium includes, but is not limited to, a disk memory, an optical memory, a flash memory, etc.

[0109] The processor 62 may be implemented by a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, and other discrete hardware components. Accordingly, each module such as an acquisition module, a calculation module, and an adjustment module may be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or may be implemented by a dedicated circuit that executes corresponding steps.

[0110] For example, the processor 62 is configured to execute instructions stored in the memory to implement the following Figures 2 to 4 The method of any one of the embodiments.

[0111] The bus 63 may use any of a variety of bus structures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.

[0112] The interfaces 64, 65, 66 of the task management device 60 and the memory 61 and the processor 62 can be connected via a bus 63. The input / output interface 64 provides a connection interface for input / output devices such as a display, a mouse, and a keyboard. The network interface 65 provides a connection interface for various networked devices. The storage interface 66 provides a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.

[0113] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of frames can be implemented by computer-readable program instructions.

[0114] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.

[0115] These computer-readable program instructions may also be stored in a computer-readable memory, which cause the computer to work in a specific manner to produce an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.

[0116] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.

[0117] The present disclosure also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the following is implemented: Figures 2 to 4 The method of any one of the embodiments.

[0118] The present disclosure also provides a computer program product, including computer instructions, wherein when the computer instructions are executed by a processor, the following is achieved: Figures 2 to 4 The method of any one of the embodiments.

[0119] Figure 7 FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Figure 7 As shown, the electronic device 70 includes a task management device 71, and the task management device 71 includes Figure 5 or Figure 6 A task management device according to any one of the embodiments.

[0120] Figure 8 It is a schematic structural diagram of an electronic device according to another embodiment of the present disclosure. Figure 8 and Figure 7 The difference is that in Figure 8In the embodiment, the electronic device includes not only the task management device 71 but also an interaction device 72 .

[0121] The interaction device 72 is configured to send a first request to the server, and send the task corresponding to the first request sent by the server to the task management device, so as to realize task downloading.

[0122] In some embodiments, the interaction device 72 is configured to send a second request to the server based on the version update information of the specified task sent by the server, and send the updated version of the specified task sent by the server to the task management device so as to download the updated version of the task.

[0123] Fig. 9 FIG. 1 is a schematic diagram of the structure of a network system according to an embodiment of the present disclosure. Fig. 9 As shown, the network system includes a task issuing device 91, a server 92 and an electronic device 93. The electronic device 93 is Figure 8 An electronic device according to any one of the embodiments.

[0124] For example, the server 92 is a CDN (Content Delivery Network) server.

[0125] For the sake of simplicity, Fig. 9 In the figure, one electronic device is shown. In actual scenarios, multiple electronic devices can be set in the network system as needed.

[0126] The task issuing device 91 is configured to issue tasks.

[0127] The server 92 is configured to store the tasks issued by the task issuing device 91, and according to the first request sent by the electronic device 93, send the task corresponding to the first request to the electronic device 93, so that the electronic device 93 can download the requested task.

[0128] In some embodiments, the server 92 is configured to send version update information of the specified task to the electronic device 93 if an updated version of the specified task exists, and to send the updated version of the specified task to the electronic device 93 based on a second request sent by the electronic device 93 so that the electronic device 93 can download the updated version of the task.

[0129] Fig.10 A schematic diagram of the structure of a network system according to another embodiment of the present disclosure.

[0130] like Fig.10As shown, developers use the computing container in the task publishing device to develop and debug computing tasks. When the computing task is tested and verified to be correct, the task publishing device publishes the computing task to the CDN server. The CDN server stores all computing tasks to be deployed. When the electronic device is started, the electronic device will download the required computing tasks from the CDN server and store them locally. When the application or service on the electronic device triggers a related task, the computing container in the electronic device will execute the related task, thereby achieving fast and efficient computing task deployment and execution.

[0131] In the case that the CDN server has an updated version of the specified computing task, the CDN server sends the version update information of the specified computing task to the electronic device. The electronic device sends a second request to the CDN server as needed, and the CDN server sends the updated version of the specified task to the electronic device to implement a hot update of the specified computing task.

[0132] It should be noted here that Fig.10 The electronic device shown in the figure may adopt different systems, for example, the electronic device may adopt Android system, iOS system, Linux system, etc.

[0133] By implementing the above-mentioned embodiments of the present disclosure, the following beneficial effects can be obtained.

[0134] 1) Design lightweight containers: To reduce the demand for computing and storage resources on the end-side devices, lightweight computing containers are designed to effectively improve the portability and execution efficiency of computing tasks. For example, when designing a virtual machine using Python, Python's global interpreter lock is removed to achieve parallel execution at the multi-task thread level.

[0135] 2) Achieve heterogeneous support and task isolation: Computing containers achieve task isolation by packaging computing tasks and their dependencies into independent units. This reduces naming conflicts and mutual influence between global variables, and improves the security and stability of task execution. At the same time, by encapsulating the basic libraries of hardware and operating systems, compatibility with different operating systems is achieved.

[0136] 3) Implement resource management and task scheduling: The computing container uses resource evaluation and task priority strategies to reasonably allocate limited end-side computing device resources. By maintaining task processing queues and candidate queues, efficient task scheduling and execution are achieved, which helps to improve the execution speed of computing tasks and resource utilization.

[0137] 4) Realize dynamic update and fault-tolerant rollback: The computing container supports hot update of computing tasks, realizing the rapid replacement and update of computing tasks. At the same time, with the help of the exception capture and processing mechanism of the virtual machine, the fault-tolerant rollback function is realized. When an exception occurs, the computing container can capture and process it in time without affecting the execution of other tasks and the availability of the computing container.

[0138] In some embodiments, the functional modules described above can be implemented as a general-purpose processor, a programmable logic controller (PLC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components or any appropriate combination thereof for performing the functions described in the present disclosure.

[0139] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0140] The description of the present disclosure is given for the purpose of illustration and description, and is not intended to be exhaustive or to limit the present disclosure to the disclosed form. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present disclosure, and to enable those of ordinary skill in the art to understand the present disclosure and thereby design various embodiments with various modifications suitable for specific uses.

Claims

1. A task management method, executed by a task management device, comprising: According to the received task identifier, extracting the to-be-executed task corresponding to the task identifier from the task pool of the computing container; In a case where the computing resources required by the task to be executed are less than or equal to the current idle computing resources of the computing container, allocating the required computing resources to the task to be executed; The task to be executed is executed using the virtual machine in the computing container.

2. The task management method according to claim 1, further comprising: In a case where the computing resources required by the task to be executed are greater than the currently idle computing resources of the computing container, the task to be executed is moved as a candidate task to a candidate queue of the computing container.

3. The task management method according to claim 1, wherein: The executing of the task to be executed comprises: Moving the to-be-executed task to the task processing queue of the computing container; Determining whether the task processing queue only includes the tasks to be executed; In a case where the task processing queue only includes the to-be-executed tasks, the to-be-executed tasks are executed using the virtual machine.

4. The task management method according to claim 3, wherein: The executing of the task to be executed comprises: In the case where the task processing queue includes a plurality of tasks, the plurality of tasks are executed in sequence by using the virtual machine in the order of task priority from high to low.

5. The task management method according to claim 3 or 4, further comprising: When the virtual machine completes the currently executed task, the computing resources allocated to the currently executed task are released.

6. The task management method according to claim 5, further comprising: In the case of releasing the computing resources allocated to the currently executed task, determining whether the candidate queue of the computing container includes the candidate task; In a case where the candidate task is included in the candidate queue, selecting, from the candidate tasks, a task whose required computing resources are less than the current idle computing resources of the computing container according to the task priority of the candidate task; Allocate required computing resources to the selected task, and move the selected task into the task processing queue.

7. The task management method according to any one of claims 1 to 4, further comprising: In the process of executing tasks using the virtual machine, when a recoverable exception occurs in the computing container, reclaiming the tasks in the task pool; Report the execution failure information of the task to be executed.

8. The task management method according to any one of claims 1 to 4, further comprising: In the process of executing a task using the virtual machine, if an unrecoverable exception occurs in the computing container, restart the computing container.

9. The task management method according to any one of claims 1 to 4, further comprising: If there is an updated version of the specified task, obtain the updated version of the specified task from the server; Deleting the current version of the specified task in the task pool; The updated version of the specified task is stored in the task pool.

10. The task management method according to any one of claims 1 to 4, further comprising: The tasks downloaded from the server are stored in the task pool.

11. A task management device, comprising: An extraction module is configured to extract, according to the received task identifier, a to-be-executed task corresponding to the task identifier from a task pool of a computing container; A resource allocation module, configured to allocate required computing resources to the task to be executed if the computing resources required by the task to be executed are less than the current idle computing resources of the computing container; The task execution module is configured to execute the task to be executed by utilizing the virtual machine in the computing container.

12. A task management device, comprising: Memory; A processor is coupled to the memory, and the processor is configured to execute the task management method according to any one of claims 1 to 10 based on instructions stored in the memory.

13. An electronic device comprising: A task management device as claimed in claim 11 or 12.

14. The electronic device according to claim 13, further comprising: The interaction device is configured to send a first request to a server, and send a task corresponding to the first request sent by the server to the task management device.

15. The electronic device according to claim 14, wherein: The interaction device is configured to send a second request to the server according to the version update information of the designated task sent by the server, and send the updated version of the designated task sent by the server to the task management device.

16. A network system comprising: The electronic device according to any one of claims 13 to 15; A task publishing device is configured to publish tasks; The server is configured to store the tasks issued by the task issuing device, and send the task corresponding to the first request to the electronic device according to the first request sent by the electronic device.

17. The network system according to claim 16, wherein: The server is configured to send version update information of the designated task to the electronic device if an updated version exists for the designated task, and send the updated version of the designated task to the electronic device according to a second request sent by the electronic device.

18. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the task management method according to any one of claims 1 to 10 is implemented.

19. A computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, the task management method according to any one of claims 1 to 10 is implemented.