CN113342493A - Task execution method and device and computer equipment - Google Patents

Task execution method and device and computer equipment Download PDF

Info

Publication number
CN113342493A
CN113342493A CN202110658875.0A CN202110658875A CN113342493A CN 113342493 A CN113342493 A CN 113342493A CN 202110658875 A CN202110658875 A CN 202110658875A CN 113342493 A CN113342493 A CN 113342493A
Authority
CN
China
Prior art keywords
task
execution
target
registry
subtask
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110658875.0A
Other languages
Chinese (zh)
Other versions
CN113342493B (en
Inventor
孙帅
赵淑超
杜峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202110658875.0A priority Critical patent/CN113342493B/en
Publication of CN113342493A publication Critical patent/CN113342493A/en
Application granted granted Critical
Publication of CN113342493B publication Critical patent/CN113342493B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5066Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/812Monomedia components thereof involving advertisement data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a task execution method, a task execution device and computer equipment, wherein the method comprises the following steps: acquiring a target task, wherein the target task comprises a plurality of subtasks; in response to executing a target task, a task manager calls a task registry corresponding to the target task and inquires the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task; and sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask. The present application also provides a computer-readable storage medium. According to the method and the device, the execution priority of each subtask can be quickly inquired from the task registry in the target task execution process, and each subtask is sequentially executed, so that the task execution time is shortened, and the task execution efficiency is improved.

Description

Task execution method and device and computer equipment
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for task execution and a computer device.
Background
With the development of internet technology and computer technology, more and more functions can be realized by intelligent electronic devices. Based on this, a user may install many applications in the electronic device to implement various functions. For example, a user may install a game-like application, an online video-playing-like application, an audio-playing-like application, and the like in the electronic device. These applications can meet the needs of users for entertainment and learning. As more and more applications are installed in electronic devices, the response speed of the electronic devices becomes slower. For example, after a user opens a plurality of applications using the electronic device, the response speed is much slower while the newly opened application is opened.
However, the electronic device automatically loads the loading task of each application program based on the natural sequence of the application program loading tasks, which results in a long time consuming loading process of the application program and poor user experience.
Disclosure of Invention
The application provides a task execution method and device and computer equipment, and can solve the problems that in the prior art, electronic equipment consumes long time in a task execution process and user experience is poor.
First, to achieve the above object, the present application provides a task execution method, including:
acquiring a target task, wherein the target task comprises a plurality of subtasks; in response to executing a target task, a task manager calls a task registry corresponding to the target task and inquires the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task; and sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask.
In one example, in response to executing the target task, the task manager invoking a task registry corresponding to the target task includes: monitoring whether a task registry of the task manager is updated or not; and when the task registry is monitored to be updated, directly calling the updated task registry.
In one example, the method further comprises: receiving an updating operation request of a user for the task registry, wherein the updating operation request comprises task deletion, task addition, execution priority modification of subtasks and deletion or addition of subtasks in task nodes; and updating the task registry according to the updating operation request.
In one example, in response to executing the target task, the task manager invoking a task registry corresponding to the target task includes: acquiring hardware parameters of a terminal, wherein the hardware parameters comprise at least one item of available operation memory, CPU core number or network bandwidth; and selecting a task registry which is matched with the hardware parameters from a plurality of task registries in the task manager for calling.
In one example, the method further comprises: monitoring the execution duration of the task content corresponding to each task node of each subtask; and adjusting the execution priority of each subtask in the task registry at each task node according to the execution duration.
In one example, the method further comprises: monitoring the execution duration of the task content corresponding to each task node of each subtask; and scheduling the subtasks with the execution duration being greater than the preset threshold value to preset sub threads for execution.
In one example, when the target task is a task of loading a video live broadcast room, the subtask includes at least one of a bullet screen information loading task, a gift information loading task, an advertisement operation information loading task or a live broadcast room skin loading task.
In addition, to achieve the above object, the present application also provides a task performing apparatus, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target task, and the target task comprises a plurality of subtasks; the query module is used for responding to the execution of a target task, calling a task registry corresponding to the target task by a task manager, and querying the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task; and the execution module is used for sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask.
Further, the present application also proposes a computer device, which includes a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and the computer program implements the steps of the task execution method as described above when executed by the processor.
Further, to achieve the above object, the present application also provides a computer-readable storage medium storing a computer program, which is executable by at least one processor to cause the at least one processor to perform the steps of the task execution method as described above.
Compared with the prior art, the task execution method, the task execution device, the computer equipment and the computer-readable storage medium can acquire the target task, wherein the target task comprises a plurality of subtasks; in response to executing a target task, a task manager calls a task registry corresponding to the target task and inquires the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task; and sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask. By presetting the execution priority of each subtask of a target task in each task node of the target task in a task registry, when the target task is executed, the execution priority of each subtask can be quickly inquired from the task registry and each subtask can be sequentially executed, so that the task execution time is shortened, and the task execution efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of an application environment according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a method for performing tasks according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating an effect of a process for executing a live view load task according to an illustrative example of the present application;
FIG. 4 is a flowchart illustrating an effect of a process of loading each sub-task of a task in a live broadcast room according to a preset execution priority in a task registry in accordance with an exemplary embodiment of the present application;
FIG. 5 is a flowchart illustrating the effect of updating the execution priority in the task registry in real-time to adjust the execution priority of each sub-task of the live broadcast load task in an exemplary embodiment of the present application;
FIG. 6 is a graph illustrating the statistical effect of the execution time of each sub-task of a live view load task in an illustrative example of the present application;
FIG. 7 is a block diagram of program modules of an embodiment of a task execution device of the present application;
FIG. 8 is a diagram of an alternative hardware architecture of the computer device of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
Fig. 1 is a schematic diagram of an application environment according to an embodiment of the present application. Referring to fig. 1, the computer apparatus 1 is connected to a server. The computer device 1 provides a display interface for displaying an interactive interface of an application running on the computer device 1. In this embodiment, the server may be a data server corresponding to an application program installed on the computer device 1, and when the computer device 1 starts a target application program, the server is connected to the server and requests data loading of the target application program; the server then sends the data loading task of the target application to the computer device 1, i.e. the target task. Then, the computer device 1 acquires a target task, wherein the target task comprises a plurality of subtasks; calling a task registry corresponding to the target task from a preset task manager, and inquiring the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task; and when the target task is executed to the target task node, sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask. Therefore, the computer device 1 can quickly complete the data loading of the target application program and display the data loaded by the target application program on a display interface.
In the embodiment, the computer device 1 may be a mobile phone, a tablet, a portable device, a PC, or other electronic devices with a display function; the server can be used as a mobile phone, a tablet, a portable device, a PC (personal computer) or a data server and the like.
Example one
Fig. 2 is a schematic flowchart of an embodiment of a task execution method according to the present application. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is made by way of example with the computer device 1 in fig. 1 as the execution subject.
As shown in fig. 2, the task execution method may include steps S200 to S204.
Step S200, a target task is obtained, and the target task comprises a plurality of subtasks.
Step S202, responding to the execution of the target task, the task manager calls a task registry corresponding to the target task, and inquires the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task.
Specifically, when the computer device 1 executes a target task according to an operation instruction of a user or according to a request sent by another device, then the computer device 1 obtains the target task including all subtasks of the target task.
In an illustrative example, when the target task is a task of loading a video live broadcast room, the subtask includes at least one of a bullet screen information loading task, a gift information loading task, an advertisement operation information loading task, or a live broadcast room skin loading task. For example, when the computer device 1 runs a target task of a live video broadcast room triggered by user touch or runs a target task of a live video broadcast room sent by a remote control device, the computer device 1 may obtain bullet screen information data, gift information data, advertisement operation information data, and skin data of the live video broadcast room from a server, and use the bullet screen information data, the gift information data, the advertisement operation information data, and the skin data of the live video broadcast room as subtasks for running the live video broadcast room.
Then, the computer device 1 calls a task registry corresponding to the target task from a preset task manager, and queries the execution priority of each subtask in the target task node from the task registry. In this embodiment, the computer device 1 is preset with a task manager, where a preset task registry is stored in the task manager, where the task registry includes each task node in an execution process corresponding to the target task, and an execution priority of each subtask of the target task. Therefore, when the computer device 1 receives the target task and acquires the subtasks of the target task, the execution priority of each task node of all the subtasks of the target task is queried from the task registry. Of course, in other embodiments, the execution priority may also be a weight value, and after the computer device 1 obtains the weight value, the execution priority of each subtask is determined according to the size of the weight value.
In an exemplary example, the computer device 1 invoking the task registry corresponding to the target task from a preset task manager further includes: monitoring whether a task registry of the task manager is updated; and when the task registry is monitored to be updated, directly calling the updated task registry. For example, the computer device 1 may adjust the execution priority of each subtask of the target task at any task node according to the task registry written by the user in real time by monitoring whether the task manager writes a new task registry; dynamically managing the execution priority of each subtask of the target task is achieved. In a specific embodiment, the computer device 1 may receive an update operation request of a user for the task registry, where the update operation request includes task deletion, task addition, modification of execution priority of a subtask, and deletion or addition of a subtask in a task node; and updating the task registry according to the updating operation request.
Of course, in another exemplary example, the computer device 1 invoking the task registry corresponding to the target task from the preset task manager further includes: acquiring hardware parameters of a terminal; and selecting a task registry which is matched with the hardware parameters from a plurality of task registries in the task manager for calling. Wherein the hardware parameter includes at least one of available operating memory, CPU core number or network bandwidth. In this embodiment, the computer device 1 pre-sets a plurality of task registries in the task manager, each task registry is provided with matched hardware parameters, such as an available operating memory, a CPU core number, or a network bandwidth, then, after the computer device 1 acquires the target task and each subtask, the computer device 1 further acquires the current hardware parameters of the computer device 1, including the available operating memory, the CPU core number, and the network bandwidth, then selects a matched task registry from the task manager according to the available operating memory, the CPU core number, and the network bandwidth, and queries the execution priority of each subtask of the target task at any task node from the task registry.
And step S204, sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask.
After the computer device 1 queries the execution priority of each subtask of the target task at a target task node, the target task node is any task node in the execution process of the target task; and the computer device 1 may sequentially execute the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask when the target task is executed to the target.
Referring to fig. 3, fig. 3 is a flowchart illustrating an execution process of a live view loading task in an exemplary example of the present application. In this embodiment, the target task acquired by the computer device 1 is a live broadcast loading task, and the live broadcast loading task includes subtasks including a task a, a task B, a task C, and a task D; the live broadcast loading task is divided into 3 task nodes, wherein the 3 task nodes comprise a P0 node and a P1 node, and the initialization task node is executed when the computer device 1 receives the live broadcast loading task; after the initialization of the nodes is completed, the computer apparatus 1 sequentially executes the P0 node and the P1 node, including: sending a P0 interface request to the server, requesting successful execution of the P0 node; and sending a P1 interface request to the server, wherein the request successfully executes the P1 node. The computer device 1 executes each sub-task corresponding to the live loading task at each task node, and certainly, the task node is not limited to include all sub-tasks.
Referring to fig. 4, fig. 4 is a flowchart illustrating an effect of loading each sub-task of the live broadcast room in sequence according to the execution priority preset in the task registry in an exemplary embodiment of the present application. Specifically, fig. 4 is a process executed for the live load task in fig. 3, including: the computer device 1 obtains a task registry from a preset task scheduling manager, wherein the task registry comprises the execution priority of each subtask in each task node. For example, the subtasks include task A, task B, task C, and task D; the task nodes comprise an initialization node, a P0 node and a P1 node; the preset execution priority of the registry comprises the following steps: at an initialization node, the priority of a task A is 1, the priority of a task B is 2, and the priority of a task C is 3; at the node P0, the priority of task a is 1, the priority of task B is 2, the priority of task C is 3, and the priority of task D is 4; at the P1 node, task a has a priority of 1, task B has a priority of 2, task C has a priority of 3, and task D has a priority of 4. Then, in the process of executing the live broadcast loading task, the computer device 1 executes the task a, the task B and the task C in sequence at the initialization node; executing the task A, the task B, the task C and the task D in the P0 node in sequence; task a, task B, task C, and task D are executed in sequence at node P1.
With continuing reference to fig. 5, fig. 5 is a flowchart illustrating an exemplary embodiment of updating the execution priority in the task registry in real time to adjust the execution priority of each sub-task of the live broadcast load task. Specifically, fig. 5 is a process of updating the task registry in fig. 4 to affect the execution priority of each subtask in each task node of the live broadcast loading task, where the process includes: the computer device 1 acquires an updated task registry from the task scheduling manager, wherein the task registry adjusts the execution priority of each subtask of the initialization node: newly adding a task E, wherein the priority of the task A is 1, the priority of the task B is 2, the priority of the task E is 3, and the priority of the task C is 4; the execution priority of each subtask of the P1 node is adjusted: task a has a priority of 3, task B has a priority of 2, task C has a priority of 1, and task D has a priority of 4. Therefore, in the process of executing the live broadcast loading task, the computer device 1 executes the task a, the task B, the task E and the task C in sequence at the initialization node; executing the task A, the task B, the task C and the task D in the P0 node in sequence; task C, task B, task a, and task D are executed in sequence at node P1. That is to say, the computer device 1 can obtain the execution priority of each sub-task in the target task node in the hot-updated task registry, and sequentially execute each sub-task according to the obtained execution priority when the target task is executed to the target task node.
In an illustrative example, the computer device 1 further performs: monitoring the execution duration of the task content corresponding to each task node of each subtask; and adjusting the execution priority of each subtask in the task registry at each task node according to the execution duration.
In another illustrative example, the computer device 1 further performs: monitoring the execution duration of the task content corresponding to each task node of each subtask; and scheduling the subtasks with the execution duration being greater than the preset threshold value to preset sub threads for execution.
Referring to fig. 6, fig. 6 is a diagram illustrating the statistical effect of the execution time of each sub-task of the live broadcast loading task in an exemplary embodiment of the present application. In this embodiment, the computer device 1 calculates the execution time of each task in the live broadcast load task at each task node, for example, the execution times of task a, task B, task C, and task D at the initialization node, and the execution times of the P0 node and the P1 node are respectively: 10us, 10us and 16 us; 15us, 8us and 6 us; 7us, 25us and 5 us; 0us, 13us and 12 us. Then, the computer device 1 displays the execution time of each sub-task of the target task at each task node in a manner of a statistical graph, so that a user can make a scheduling arrangement for the target task, for example, whether to adjust the sub-task (P0 task C) with the execution time exceeding a preset first time threshold, for example, 20us, to a preset sub-thread execution; or adjusting the subtask (P0 task C) with the total execution time exceeding the maximum execution time in the task node (P0 node) with the preset second time threshold value, such as 50us, to other task nodes (e.g., to exchange with the initialization task C in the initialization node), so as to balance the execution time of each task node and ensure the smooth and efficient execution of the target task.
In summary, the task execution method provided by the present application can obtain a target task, where the target task includes a plurality of subtasks; calling a task registry corresponding to the target task from a preset task manager, and inquiring the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task; and when the target task is executed to the target task node, sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask. By presetting the execution priority of each subtask of a target task in each task node of the target task in a task registry, when the target task is executed, the execution priority of each subtask can be quickly inquired from the task registry and each subtask can be sequentially executed, so that the task execution time is shortened, and the task execution efficiency is improved.
Example two
Fig. 7 schematically shows a block diagram of a task execution device according to the second embodiment of the present application, which may be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiments of the present application. The program modules referred to in the embodiments of the present application refer to a series of computer program instruction segments that can perform specific functions, and the following description will specifically describe the functions of the program modules in the embodiments.
As shown in fig. 7, the task performing apparatus 400 may include an obtaining module 410, a querying module 420, and an executing module 430, wherein:
an obtaining module 410, configured to obtain a target task, where the target task includes multiple subtasks. When the target task is a task for loading a video live broadcast room, the subtask comprises at least one of a bullet screen information loading task, a present information loading task, an advertisement operation information loading task or a live broadcast room skin loading task.
The query module 420 is configured to, in response to executing a target task, invoke a task registry corresponding to the target task, and query, from the task registry, an execution priority of each subtask in a target task node, where the target task node is any task node in the execution process of the target task.
The executing module 430 is configured to sequentially execute task content of each sub-task corresponding to the target task node according to the execution priority corresponding to each sub-task.
In an illustrative example, the query module 420 is further configured to: monitoring whether a task registry of the task manager is updated or not; and when the task registry is monitored to be updated, directly calling the updated task registry. Receiving an updating operation request of a user for the task registry, wherein the updating operation request comprises task deletion, task addition, execution priority modification of subtasks and deletion or addition of subtasks in task nodes; and updating the task registry according to the updating operation request.
In an illustrative example, the query module 420 is further configured to: acquiring hardware parameters of a terminal; and selecting a task registry which is matched with the hardware parameters from a plurality of task registries in the task manager for calling. Wherein the hardware parameter includes at least one of available operating memory, CPU core number or network bandwidth.
In an illustrative example, the execution module 430 is further configured to: monitoring the execution duration of the task content corresponding to each task node of each subtask; and adjusting the execution priority of each subtask in the task registry at each task node according to the execution duration. Or monitoring the execution duration of the task content corresponding to each task node of each subtask; and scheduling the subtasks with the execution duration being greater than the preset threshold value to preset sub threads for execution.
EXAMPLE III
Fig. 8 schematically shows a hardware architecture diagram of a computer device corresponding to the computer device 1 suitable for implementing the task execution method according to the third embodiment of the present application. In the present embodiment, the computer device 1 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set in advance or stored. For example, the server may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) with a gateway function. As shown in fig. 8, the computer devices include at least, but are not limited to: memory 510, processor 520, and network interface 530 may be communicatively linked to each other by a system bus. Wherein:
the memory 510 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 510 may be an internal storage module of the computer device, such as a hard disk or a memory of the computer device 1. In other embodiments, the memory 510 may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 1. Of course, the memory 510 may also comprise both an internal memory module and an external memory device of the computer device 1. In this embodiment, the memory 510 is generally used for storing an operating system and various application software installed on the computer device, such as program codes of a task execution method. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 520 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 520 is generally used for controlling the overall operation of the computer device, such as performing control and processing related to data interaction or communication with the computer device 1. In this embodiment, processor 520 is configured to execute program codes stored in memory 510 or process data.
Network interface 530 may include a wireless network interface or a wired network interface, and network interface 530 is typically used to establish communication links between the computer device and other devices. For example, the network interface 530 is used to connect the computer device to an external terminal via a network, establish a data transmission channel and a communication link between the computer device 1 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), or Wi-Fi.
It is noted that fig. 8 only shows the computer device 1 with the components 510 and 530, but it is to be understood that not all of the shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the program code of the task execution method stored in the memory 510 may also be divided into one or more program modules and executed by one or more processors (in this embodiment, the processor 520) to implement the embodiments of the present application.
Example four
The present embodiments also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring a target task, wherein the target task comprises a plurality of subtasks; in response to executing a target task, a task manager calls a task registry corresponding to the target task and inquires the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task; and sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program code of the task execution method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different from that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications that can be made by the use of the equivalent structures or equivalent processes in the specification and drawings of the present application or that can be directly or indirectly applied to other related technologies are also included in the scope of the present application.

Claims (10)

1. A method of task execution, the method comprising:
acquiring a target task, wherein the target task comprises a plurality of subtasks;
in response to executing a target task, a task manager calls a task registry corresponding to the target task and inquires the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task;
and sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask.
2. The task execution method of claim 1, wherein, in response to executing a target task, a task manager invokes a task registry corresponding to the target task comprises:
monitoring whether a task registry of the task manager is updated;
and when the task registry is monitored to be updated, directly calling the updated task registry.
3. The task execution method of claim 2, wherein the method further comprises:
receiving an updating operation request of a user for the task registry, wherein the updating operation request comprises task deletion, task addition, execution priority modification of subtasks and deletion or addition of subtasks in task nodes;
and updating the task registry according to the updating operation request.
4. The task execution method of claim 1, wherein, in response to executing a target task, a task manager invokes a task registry corresponding to the target task comprises:
acquiring hardware parameters of a terminal, wherein the hardware parameters comprise at least one item of available operation memory, CPU core number or network bandwidth;
and selecting a task registry which is matched with the hardware parameters from a plurality of task registries in the task manager for calling.
5. The task execution method of claim 1, wherein the method further comprises:
monitoring the execution duration of the task content corresponding to each task node of each subtask;
and adjusting the execution priority of each subtask in the task registry at each task node according to the execution duration.
6. The task execution method of claim 1, wherein the method further comprises:
monitoring the execution duration of the task content corresponding to each task node of each subtask;
and scheduling the subtasks with the execution duration being greater than the preset threshold value to preset sub threads for execution.
7. The task execution method of any one of claims 1 to 6, wherein when the target task is a task of loading a video live broadcast, the subtask includes at least one of a bullet screen information loading task, a gift information loading task, an advertisement operation information loading task, or a live broadcast skin loading task.
8. A task execution apparatus, characterized in that the apparatus comprises:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target task, and the target task comprises a plurality of subtasks;
the query module is used for responding to the execution of a target task, calling a task registry corresponding to the target task by a task manager, and querying the execution priority of each subtask in a target task node from the task registry, wherein the target task node is any task node in the execution process of the target task;
and the execution module is used for sequentially executing the task content of each subtask corresponding to the target task node according to the execution priority corresponding to each subtask.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory, a processor, the memory having stored thereon a computer program being executable on the processor, the computer program, when executed by the processor, realizing the steps of the task execution method according to any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executable by at least one processor to cause the at least one processor to perform the steps of the task execution method according to any one of claims 1-7.
CN202110658875.0A 2021-06-15 2021-06-15 Task execution method and device and computer equipment Active CN113342493B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110658875.0A CN113342493B (en) 2021-06-15 2021-06-15 Task execution method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110658875.0A CN113342493B (en) 2021-06-15 2021-06-15 Task execution method and device and computer equipment

Publications (2)

Publication Number Publication Date
CN113342493A true CN113342493A (en) 2021-09-03
CN113342493B CN113342493B (en) 2022-09-20

Family

ID=77477012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110658875.0A Active CN113342493B (en) 2021-06-15 2021-06-15 Task execution method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN113342493B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178664A (en) * 2007-12-12 2008-05-14 北京中星微电子有限公司 Task scheduling method and system in real-time operating system
CN101296199A (en) * 2008-06-27 2008-10-29 腾讯科技(深圳)有限公司 Method for instant communication tool scheduling task, and instant communication tool
CN101566957A (en) * 2008-04-25 2009-10-28 恩益禧电子股份有限公司 Information processing system and task execution control method
US20110202924A1 (en) * 2010-02-17 2011-08-18 Microsoft Corporation Asynchronous Task Execution
US9135581B1 (en) * 2011-08-31 2015-09-15 Amazon Technologies, Inc. Resource constrained task scheduling
CN106326066A (en) * 2015-07-07 2017-01-11 北京东土科技股份有限公司 Method and system for monitoring and adjusting task response performance of embedded system
CN106844055A (en) * 2017-01-25 2017-06-13 北京百分点信息科技有限公司 A kind of execution method and apparatus of task
CN107346263A (en) * 2017-06-29 2017-11-14 上海联影医疗科技有限公司 Task executing method, storage medium and computer equipment
CN108804215A (en) * 2018-06-12 2018-11-13 北京奇艺世纪科技有限公司 A kind of task processing method, device and electronic equipment
CN109408215A (en) * 2018-11-07 2019-03-01 郑州云海信息技术有限公司 A kind of method for scheduling task and device of calculate node
CN109725993A (en) * 2018-06-01 2019-05-07 中国平安人寿保险股份有限公司 Task executing method, device, equipment and computer readable storage medium
CN109901920A (en) * 2019-01-18 2019-06-18 中国平安财产保险股份有限公司 Method for scheduling task and device, electric terminal
WO2019183861A1 (en) * 2018-03-28 2019-10-03 深圳市大疆创新科技有限公司 Method, device, and machine readable storage medium for task processing
CN110688210A (en) * 2019-09-17 2020-01-14 Oppo广东移动通信有限公司 Task priority determination method and device
CN111708799A (en) * 2020-04-30 2020-09-25 咪咕文化科技有限公司 Spark task processing method and device, electronic equipment and storage medium
CN111880918A (en) * 2020-07-28 2020-11-03 南京市城市与交通规划设计研究院股份有限公司 Road network front end rendering method and device and electronic equipment
CN112346829A (en) * 2019-08-07 2021-02-09 上海云盾信息技术有限公司 Method and equipment for task scheduling
CN112783630A (en) * 2021-02-01 2021-05-11 佛山市顺德区美的洗涤电器制造有限公司 Task scheduling method, intelligent gas stove and computer readable storage medium

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178664A (en) * 2007-12-12 2008-05-14 北京中星微电子有限公司 Task scheduling method and system in real-time operating system
CN101566957A (en) * 2008-04-25 2009-10-28 恩益禧电子股份有限公司 Information processing system and task execution control method
CN101296199A (en) * 2008-06-27 2008-10-29 腾讯科技(深圳)有限公司 Method for instant communication tool scheduling task, and instant communication tool
US20110202924A1 (en) * 2010-02-17 2011-08-18 Microsoft Corporation Asynchronous Task Execution
US9135581B1 (en) * 2011-08-31 2015-09-15 Amazon Technologies, Inc. Resource constrained task scheduling
CN106326066A (en) * 2015-07-07 2017-01-11 北京东土科技股份有限公司 Method and system for monitoring and adjusting task response performance of embedded system
CN106844055A (en) * 2017-01-25 2017-06-13 北京百分点信息科技有限公司 A kind of execution method and apparatus of task
CN107346263A (en) * 2017-06-29 2017-11-14 上海联影医疗科技有限公司 Task executing method, storage medium and computer equipment
WO2019183861A1 (en) * 2018-03-28 2019-10-03 深圳市大疆创新科技有限公司 Method, device, and machine readable storage medium for task processing
CN109725993A (en) * 2018-06-01 2019-05-07 中国平安人寿保险股份有限公司 Task executing method, device, equipment and computer readable storage medium
CN108804215A (en) * 2018-06-12 2018-11-13 北京奇艺世纪科技有限公司 A kind of task processing method, device and electronic equipment
CN109408215A (en) * 2018-11-07 2019-03-01 郑州云海信息技术有限公司 A kind of method for scheduling task and device of calculate node
CN109901920A (en) * 2019-01-18 2019-06-18 中国平安财产保险股份有限公司 Method for scheduling task and device, electric terminal
CN112346829A (en) * 2019-08-07 2021-02-09 上海云盾信息技术有限公司 Method and equipment for task scheduling
CN110688210A (en) * 2019-09-17 2020-01-14 Oppo广东移动通信有限公司 Task priority determination method and device
CN111708799A (en) * 2020-04-30 2020-09-25 咪咕文化科技有限公司 Spark task processing method and device, electronic equipment and storage medium
CN111880918A (en) * 2020-07-28 2020-11-03 南京市城市与交通规划设计研究院股份有限公司 Road network front end rendering method and device and electronic equipment
CN112783630A (en) * 2021-02-01 2021-05-11 佛山市顺德区美的洗涤电器制造有限公司 Task scheduling method, intelligent gas stove and computer readable storage medium

Also Published As

Publication number Publication date
CN113342493B (en) 2022-09-20

Similar Documents

Publication Publication Date Title
JP6695984B2 (en) Multitask scheduling method, system, application server, and computer-readable storage medium
CN113641457B (en) Container creation method, device, apparatus, medium, and program product
CN111490963B (en) Data processing method, system, equipment and storage medium based on QUIC protocol stack
CN111930525B (en) GPU resource use method, electronic device and computer readable medium
EP4060496A2 (en) Method, apparatus, device and storage medium for running inference service platform
CN113961346A (en) Data cache management and scheduling method and device, electronic equipment and storage medium
CN112422450B (en) Computer equipment, and flow control method and device for service request
CN112631680A (en) Micro-service container scheduling system, method, device and computer equipment
CN112416888A (en) Dynamic load balancing method and system for distributed file system
CN115185679A (en) Task processing method and device for artificial intelligence algorithm, server and storage medium
CN113726676B (en) Redis-based API interface current limiting method, redis-based API interface current limiting device, computer equipment and storage medium
CN108255735A (en) Associated environment test method, electronic device and computer readable storage medium
CN113590433A (en) Data management method, data management system, and computer-readable storage medium
CN113342493B (en) Task execution method and device and computer equipment
CN111400051B (en) Resource scheduling method, device and system
CN115297076B (en) Offline message pulling method and device, computer equipment and storage medium
CN116185578A (en) Scheduling method of computing task and executing method of computing task
CN113392131A (en) Data processing method and device and computer equipment
CN112688980B (en) Resource distribution method and device, and computer equipment
CN111556126B (en) Model management method, system, computer device and storage medium
CN114416438A (en) Data export method and device, computer equipment and scheduling service system
CN109582680B (en) Business processing method based on new product development, electronic device and readable storage medium
CN110321335B (en) Modeling data downloading method and device, electronic equipment and computer storage medium
CN113296913A (en) Data processing method, device and equipment based on single cluster and storage medium
CN112015551A (en) Coroutine pool management method and coroutine pool management device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant