CN112667386A - Task management method and device, storage medium and electronic equipment - Google Patents

Task management method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112667386A
CN112667386A CN202110064695.XA CN202110064695A CN112667386A CN 112667386 A CN112667386 A CN 112667386A CN 202110064695 A CN202110064695 A CN 202110064695A CN 112667386 A CN112667386 A CN 112667386A
Authority
CN
China
Prior art keywords
task
target
event
module
function module
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.)
Pending
Application number
CN202110064695.XA
Other languages
Chinese (zh)
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202110064695.XA priority Critical patent/CN112667386A/en
Publication of CN112667386A publication Critical patent/CN112667386A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a task management method and device, a storage medium and electronic equipment. Wherein, the method comprises the following steps: under the condition of receiving a service processing instruction, acquiring a task list currently managed by a task management module, wherein the service processing instruction is used for indicating a target service event to be processed in a target function module; searching a target task in a task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for managing a functional module; and under the condition that the target task is found from the task list, registering the target function module into the target task, and processing the target service event through the target task. The invention solves the technical problem of resource waste caused by task operation.

Description

Task management method and device, storage medium and electronic equipment
Technical Field
The invention relates to the field of computers, in particular to a task management method and device, a storage medium and electronic equipment.
Background
Currently, network modules are embedded in equipment to realize the functionality of the internet of things of the equipment. In order to solve the problem of code coupling of the devices in the operation process, most of the devices adopt a function modularization operation mode.
When the functional modules are run in the device, each module creates a new task to enable the running of the functional modules. After a device starts multiple tasks, the running of the multiple tasks may occupy a large amount of system resources. In addition, the prior running framework has the started tasks mostly in an idle state, and a lot of processor resources are wasted.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a task management method and device, a storage medium and electronic equipment, and aims to at least solve the technical problem of resource waste caused by task operation.
According to an aspect of an embodiment of the present invention, there is provided a task management method, including: under the condition of receiving a service processing instruction, acquiring a task list currently managed by a task management module, wherein the service processing instruction is used for indicating a target service event to be processed in a target function module; searching a target task in the task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for managing a functional module; and under the condition that the target task is found from the task list, registering the target function module into the target task, and processing the target business event through the target task.
According to another aspect of the embodiments of the present invention, there is also provided a task management apparatus, including: the system comprises an acquisition module, a task management module and a target function module, wherein the acquisition module is used for acquiring a task list currently managed by the task management module under the condition of receiving a service processing instruction, and the service processing instruction is used for indicating a target service event to be processed in the target function module; the searching module is used for searching a target task in the task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for the management function module; and the registration module is used for registering the target function module in the target task under the condition that the target task is found from the task list, and processing the target business event through the target task.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the above task management method when running.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores therein a computer program, and the processor is configured to execute the task management method described above through the computer program.
In the embodiment of the invention, when a service processing instruction is received, a task list in a task management module is obtained, and a target task is searched according to a load parameter of an established task, so that a target function module is registered in the target task, and the target function module is registered in the existing target task, so that the problem that a new task is created for the target function module under the condition that the existing task can operate the target function module is reduced, the task is shared through the function modules, the idle processing capacity of the existing task is utilized, and the task creation is reduced, so that the technical effect that a plurality of function modules are managed by one task, the task does not need to be individually established for each function module is achieved, and the technical problem of resource waste caused by task operation is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of an application environment of an alternative task management method according to an embodiment of the invention;
FIG. 2 is a flowchart illustrating an alternative task management method according to an embodiment of the invention;
FIG. 3 is a block diagram of an alternative task management module according to an embodiment of the invention;
FIG. 4 is a flowchart illustrating an alternative task management method according to an embodiment of the invention;
FIG. 5 is a flowchart illustrating an alternative task management method according to an embodiment of the invention;
FIG. 6 is a block diagram of an alternative task according to an embodiment of the invention;
FIG. 7 is a flowchart illustrating an alternative task management method according to an embodiment of the invention;
FIG. 8 is a schematic diagram illustrating an interaction timing sequence of an alternative task management method according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of an alternative task management device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiment of the present invention, a task management method is provided, optionally, the task management method may be applied to, but not limited to, an environment as shown in fig. 1. The terminal device 102 performs data interaction with the server 112 through the network 110.
The terminal device 102 includes a plurality of functional modules and a task management module. When a target function module in the terminal device 102 needs to process a target service event, a service processing request is initiated. The terminal device 102 initiates a service processing instruction when receiving the service processing request. And the target task management module acquires a task list of the task management module under the condition of receiving the service processing instruction, wherein the task list comprises all tasks which are currently operated in the task management module. And searching a target task in the tasks contained in the task list by calculating the load parameters of each task in the task list. And under the condition that the target task is found from the task list, the task management module allocates the target task for the target function module, registers the target function module into the target task, and processes the target service event through the target task.
The terminal device 102 uploads the task operation data to the server 112 through the network 110, so that the current task operation condition of the terminal device 102 can be inquired through the server 112. Meanwhile, the terminal device 102 may view past task operation data through the network 102 to improve the current task management method and mode.
Optionally, in this embodiment, the terminal device 102 may include, but is not limited to, at least one of the following: mobile phones (such as Android phones, IOS phones, etc.), notebook computers, tablet computers, palm computers, MID (Mobile Internet Devices), PAD, desktop computers, smart televisions, etc. The network 110 may include, but is not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication. The server 112 may be a single server, a server cluster composed of a plurality of servers, or a cloud server. The above is merely an example, and this is not limited in this embodiment.
As an alternative implementation, as shown in fig. 2, the task management method includes:
s202, under the condition of receiving a service processing instruction, acquiring a task list currently managed by a task management module, wherein the service processing instruction is used for indicating a target service event to be processed in a target function module;
s204, searching a target task in the task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for managing the functional module;
s206, under the condition that the target task is found from the task list, the target function module is registered in the target task, and the target business event is processed through the target task.
Alternatively, the service processing instruction may be the result of a service processing request initiated in response to the target function module. The service processing instruction may be, but is not limited to, initiated by a service processing function in the terminal where the target function module is located.
Alternatively, the task management module may be, but is not limited to, for managing all tasks running in the terminal. The task management module may be, but is not limited to, for creation of tasks and assignment of tasks to functional modules. The task management module manages and allocates tasks for processing the business events. The number of function modules registered in each task in the task management module is not limited herein,
alternatively, the structure of the task management module, the tasks in the task list, and the function module in management may be, but is not limited to, as shown in fig. 3. The task management module 302 manages a plurality of running tasks 304, tasks 304-1, … …, and tasks 304-n, respectively. A plurality of function modules 306 are registered in each task 304. The task 304-1 has m function modules registered therein, namely a function module 306-11, a function module 306-12, … …, and a function module 306-1 m. In task 304-n, q function modules are registered, namely function modules 306-n1, 306-n2, … …, 306-nq, respectively. Wherein n, m and q are positive integers. n, m, and q are not numerically limited in any association, that is, the number of tasks 304 managed in the task management module 302 is not limited, and the number of function modules 306 registered in each task 304 is not limited or associated.
In the embodiment of the application, when a service processing instruction is received, a task list in a task management module is obtained, and a target task is searched according to a load parameter of an established task, so that a target function module is registered in the target task, and the target function module is registered in the existing target task, so that the problem that a new task is created for the target function module under the condition that the existing task can operate the target function module is reduced, the task is shared through the function modules, the idle processing capacity of the existing task is utilized, and the task creation is reduced, so that the technical effect that one task is utilized to manage a plurality of function modules, the task does not need to be individually established for each function module is achieved, and the technical problem of resource waste caused by task operation is solved.
As an alternative implementation, as shown in fig. 4, the searching for the target task in the task list according to the load parameters of each task established in the task list includes:
s402, acquiring load parameters corresponding to each task in the task list;
s404, sequentially comparing the load parameter of each task in each task with a target threshold value;
and S406, determining the task with the load parameter smaller than the target threshold value as a target task.
Optionally, the load parameter is used to indicate a load index at which the task is currently running. The load parameter may, but is not limited to, be positively correlated with the load index, the more heavily the task is run. The load parameters of the respective tasks may, but are not limited to, be related only to the corresponding task, not to the remaining tasks.
Optionally, the target threshold is a preset threshold, and is used to indicate that the task is running at an upper limit of increasing the load, and the current load of the task is in a state unsuitable for increasing.
Optionally, the load parameter of each task in each task is compared with the target threshold in sequence, which may be, but is not limited to, establishing a relevant sequence for the tasks of the multiple tasks according to the ranking sequence of the multiple tasks in the task list. The arrangement order of the plurality of tasks in the task list may be, but is not limited to, the order is arranged according to a task coding order, the order is arranged according to a task establishing correlation order, and the order is arranged according to a load index correlation order of the task operation. The order of establishing the correlation according to the tasks may be, but is not limited to, the order of establishing the time according to the tasks in a positive order and the order of establishing the time according to the tasks in a negative order. The order of the load indexes related to the task operation may be, but is not limited to, the order of the load indexes of the task operation from large to small, and the order of the load indexes of the task operation from small to large.
Optionally, by using a comparison result between the target threshold and the load parameter, in a case that the load parameter is smaller than the target threshold, it is determined that the target task exists, and a task corresponding to the load parameter is determined as the target task. And under the condition that the load parameter is greater than or equal to the target threshold, determining that the corresponding task is not the target task.
In the embodiment of the application, the load running state of the task is determined through the load parameters of the existing task, so that under the condition that the target task with idle load running is determined, the target task is used for processing the service of the target function module, the utilization rate of the existing task is improved, the creation of the task is reduced, and the running resources are saved.
As an optional implementation manner, after the target task is found in the task list, the method further includes:
and under the condition that the target task is not found in the task list, the target task is established in the task management module, the target function module is registered in the target task, and the target service event is processed through the target task.
Optionally, in the absence of a target task, that is, in the case that load parameters of all tasks currently included in the task management module are greater than or equal to a target threshold, it is determined that each currently existing task cannot bear the operation of the functional module, and a new task is created in the task management module as the target task for processing a target service event of the target functional module.
In the embodiment of the application, in order to ensure that the functional module service is normally processed under the condition that the operating loads of the existing tasks are fully loaded, the newly-built task is used as a target task for processing the functional module service, so that the operating resources are saved, and meanwhile, the normal and effective processing of the service is ensured.
As an optional implementation manner, as shown in fig. 5, the obtaining of the load parameter corresponding to each task in the task list includes:
s502, acquiring an event set and event weights corresponding to the event set, and calculating event parameters;
s504, acquiring the number and the number weight of the functional modules registered in the current task, and calculating a number parameter;
and S506, calculating a load parameter according to the event parameter and the quantity parameter.
Alternatively, the event to be processed and the registered function module in each task are separately subjected to the calculation of the load parameter. In each task, except for a target business event corresponding to a functional module registered in the task, an event which needs to be processed by the task itself exists. The event of the task other than the functional module may be, but is not limited to, an event of performing loop processing in the task. The event loop processing is to perform loop processing on events according to a preset rule.
Alternatively, the events capable of event loop processing may be, but are not limited to, timing events, IO events, message queue events, network socket and file events. Events for processing a functional module may be, but are not limited to, functional module business process events.
In the embodiment of the application, the events and the function modules in the task are subjected to independent weight distribution, and the technical mode of the load parameters is more accurate through classification, so that the load parameters can better reflect the current load condition of the task.
As an optional implementation manner, the obtaining the event set and the event weight corresponding to the event set includes:
acquiring an event contained in a current task, and determining an event type corresponding to the event;
classifying the events according to the event types to form an event set;
event weights pre-assigned to the event set are determined.
Optionally, the determining of the event type corresponding to the event may be, but is not limited to, performing type determination and classification on the event according to a set event type. The preset event type may be, but is not limited to, an event type set according to the loop processing rule, and may include, but is not limited to: timing events, IO read-write events, and message queue events.
Alternatively, the event set may be, but is not limited to, a set formed by events belonging to the same event type after the events included in the task are classified according to the event type. Each event included in the event set may exist and be processed separately or may have an association relationship.
Alternatively, the task framework may be as shown in FIG. 6. The task 602 includes a timing event 610, a message queue event 620, an IO read-write event 630, and a function module service processing event 640. The timing event 610 is used to indicate that the event type is an event set of the timing event, similarly, the message queue event 620 is used to indicate that the event type is an event set of the message queue event, and the IO read-write event 630 is used to indicate that the event type is an event set of the IO read-write event. The function module business process event is used for indicating that the event type is an event set of the function module business process event.
Alternatively, the event weight determined to be pre-assigned to the event set may be, but is not limited to, a pre-assigned weight determined according to the event type corresponding to the event set. The pre-assigned weight determined according to the event type can be, but is not limited to, the load resource required to be occupied according to the event type, and the number of events included in the event type.
Optionally, the sum of the event weight and the number weight is 1. The number weight may be, but is not limited to being, less than the event weight. The weight corresponding to the IO read/write event in the event weight may be, but is not limited to be, greater than the weights corresponding to the remaining event types.
In the embodiment of the application, the event load of the task is calculated according to the event sets and the weights corresponding to the event sets determined according to the event types, so that the event load related in the load parameters is more accurate, and the load parameters can reflect the current load condition of the task.
Alternatively, the execution flow of the task management method may be, but is not limited to, as shown in fig. 7. And executing S702 to obtain the running task of the functional module under the condition that the functional module initiates a task running requirement. After determining the running task of the functional module, executing S704, and traversing the task list in the task management module. And searching the target task for operating the functional module in the existing tasks of the task management module. In the case of traversing the task list, S706 is executed to determine whether a target task exists. If the result of the determination is yes, that is, if there is a target task with idle load operation in the task management module, S708 is executed to register the functional module to the target task. If the result of the determination in S706 is no, that is, if the loads of all tasks existing in the task management module are not idle, S710 is executed to create a new task as the target task. In the case where the creation of the new task as the target task is completed, S708 is executed, and the function module is registered to the target task.
As an optional implementation manner, the registering the target function module in the target task and processing the target business event by the target task includes:
registering a target function module in a target task through a user component, and sending a service processing instruction to the target task;
the target task responds to the service processing instruction and acquires a target service event from the task management module;
and the target task processes the target business event through the functional component.
Alternatively, the user component may be, but is not limited to, for registration and deregistration of functional modules in the target task. The user component can also obtain an operation instruction of the operation function module initiated by the user, so that the function module responds to the operation instruction to initiate a service processing instruction.
Optionally, the task management module may include, but is not limited to, a task scheduling component, which is not limited to scheduling and intermediation for business events. When the function module initiates a service processing instruction, the service event to be processed by the function module is transferred to the task management module through the task scheduling component, and under the condition of determining the target task, the service event is distributed to the target task, so that the service event is processed through the target task.
Optionally, the target task processes a target business event belonging to the business processing event of the functional module through the functional component. The functional components may be, but are not limited to, for processing functional module business process events.
As an alternative implementation, the method for registering the target function module in the target task through the user component includes:
the user component calls the task management module to send a configuration instruction to the target task;
the target task responds to the configuration instruction and determines a target interface for receiving the target function module;
and the target function module transmits the data packet of the target service event to the target task through the target interface so as to register the target function module in the target task.
Optionally, in the case of determining the target task, the user component sends a configuration instruction to the target task through the task management module to determine a target interface for transmitting the business event when the target function module is registered in the target task.
Optionally, a data packet of a service processing instruction initiated by the target function module may be transferred to the task management module by the user component before the target task is confirmed, and in a case that the target task is determined, the task management module sends a target service event indicating that the target interface is determined to the target task for processing, so as to determine the target interface for receiving the target function module. And determining that the target function module is registered in the target task under the condition that the target interface is successfully configured. And the target function module transmits the data packet of the target service event to the target task through the target interface so that the target task processes the target service event.
In the embodiment of the application, the target function module is registered in the target task through the cooperation of the user component, the task calling component in the task management module and the function component in the task, and the service event corresponding to the target function module is processed through the target task, so that the operation of the target function module is processed by the target task.
Alternatively, the application flow of the task management method may be as shown in fig. 8. The task management method comprises an initialization process, a configuration process and a binding process. The user component 801 executes S802, initializing the configuration module. The configuration module 803 executes S804 upon completion of initialization, and acquires the running task ID. When receiving the request for acquiring the task ID for the first time by the configuration module 803, the task management module 807 executes S806 to create a task. After completion of creation, the task 809 executes S808, and returns a task ID. When receiving the task ID, the task management module 805 executes S810 and returns the running task ID. When receiving the running task ID, the configuration module 803 executes S812 and returns a configuration result. In the case where the user component 801 receives the configuration result, it is confirmed that the initialization flow of the configuration module is completed.
The user component 801 executes S814, initializing the binding module. When receiving the initialization command, the binding module 805 executes S816 to obtain the running task ID. The task management module 807 confirms the task ID through the task list execution S818. And after confirming the task ID, executing S820 to return the task operation ID. The binding module 805, upon receiving the task ID for binding, executes S822 and returns a binding result. The user component 801, upon receiving the binding result, confirms that the initialization process of the binding module is completed, which also represents that the entire initialization process is completed. The completion of the initialization process may, but is not limited to, represent that the configuration module 803, the binding module 805, the task management module 807, and the tasks 809 are all in a normal operating state.
In the case that the user component 801 confirms the business processing instruction, S830 is executed to initiate a configuration request, and configure a target task for processing the business event for the function module 811. The task management module 807 confirms the task 809 for processing the business event of the functional module through the task list, and executes S832 to acquire a task interface. The task 809 assigns an interface to the function module 811 and informs the task management module 807. When the task management module 807 confirms the task interface, S834 is executed to return to the configuration interface. Upon receiving the configuration interface information, the configuration module 803 executes S836 to transmit the configuration interface to the function module 811. The function module 811 is registered in the task 809 through the configuration interface, and executes S838, returning the configuration result to the user component 801. Upon receiving the configuration result returned by the function module 811, the user component 801 determines that the function module 811 is registered in the task 809, and processes the business event of the function module 811 by the task 809.
The user component 801 executes S840, sending a binding request to the task management module 807. The task management module 807 executes S842 when receiving the binding request, sends a binding message to the task 809, and notifies the task 809, and the function module 811 will bind to the corresponding task interface to implement processing of the business event after the function module 811 by the task 809 through the corresponding task interface. The task 809 feeds back information confirming the binding to the task management module 807. The task management module 807 executes S844 to return binding feedback to the binding module 805. The binding module 805 performs S846 of transmitting the binding information for confirmation to the function module 811 to inform the function module 811 that binding is possible. The function module 811 performs S848, binding the task. After the binding is completed, S850 is performed by the task 809 to confirm the binding result to notify the task management module 807. After receiving the binding result, the task management module 807 executes S852, uploads the binding result to the cloud platform 813, and records the binding information between the function module and the task in the cloud platform 813.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the present invention, there is also provided a task management apparatus for implementing the above task management method. As shown in fig. 9, the apparatus includes:
an obtaining module 902, configured to obtain a task list currently managed by a task management module when a service processing instruction is received, where the service processing instruction is used to instruct a target function module to process a target service event;
a searching module 904, configured to search a target task in a task list according to a load parameter of each task established in the task list, where the load parameter is used to indicate a load state of the task, and the task in the task list is used to manage the functional module;
and the registering module 906 is configured to register the target function module in the target task and process the target service event through the target task when the target task is found from the task list.
Optionally, the searching module 904 includes:
the first acquiring unit is used for acquiring the load parameters corresponding to the tasks in the task list;
the comparison unit is used for sequentially comparing the load parameter of each task in each task with a target threshold value;
and the determining unit is used for determining the task with the load parameter smaller than the target threshold value as the target task.
Optionally, the first obtaining unit includes:
the event unit is used for acquiring an event set and event weights corresponding to the event set and calculating event parameters;
the module unit is used for acquiring the number and the number weight of the functional modules registered in the current task and calculating the number parameter;
and the calculating unit is used for calculating the load parameters according to the event parameters and the quantity parameters.
Optionally, the event unit includes:
the type determining unit is used for acquiring the event contained in the current task and determining the event type corresponding to the event;
the collection unit is used for classifying the events according to the event types to form an event collection;
and the weight distribution unit is used for determining the event weight pre-distributed to the event set.
Optionally, the task management apparatus further includes a creating module, where the creating module is configured to create the target task in the task management module when the target task is not found in the task list. And registering the target function module into the target task, and processing the target business event through the target task.
Optionally, the registration module 906 includes:
the registration unit is used for registering the target function module into the target task through the user component and sending a service processing instruction to the target task;
the second acquisition unit is used for responding to the service processing instruction by the target task and acquiring a target service event from the task management module;
and the processing unit is used for processing the target business event by the target task through the functional component.
Optionally, the registration unit includes:
the calling unit is used for calling the task management module by the user component so as to send a configuration instruction to the target task;
the configuration unit is used for responding to the configuration instruction by the target task and determining a target interface for receiving the target function module;
and the transmission unit is used for transmitting the data packet of the target service event to the target task by the target function module through the target interface so as to register the target function module in the target task.
In the embodiment of the application, when a service processing instruction is received, a task list in a task management module is obtained, and a target task is searched according to a load parameter of an established task, so that a target function module is registered in the target task, and the target function module is registered in the existing target task, so that the problem that a new task is created for the target function module under the condition that the existing task can operate the target function module is reduced, the task is shared through the function modules, the idle processing capacity of the existing task is utilized, and the task creation is reduced, so that the technical effect that one task is utilized to manage a plurality of function modules, the task does not need to be individually established for each function module is achieved, and the technical problem of resource waste caused by task operation is solved.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the task management method. The present embodiment is described by taking the electronic device as the terminal device shown in fig. 1 as an example. As shown in fig. 10, the electronic device comprises a memory 1002 and a processor 1004, the memory 1002 having stored therein a computer program, the processor 1004 being arranged to execute the steps of any of the method embodiments described above by means of the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, under the condition of receiving a service processing instruction, acquiring a task list currently managed by the task management module, wherein the service processing instruction is used for indicating a target service event to be processed in the target function module;
s2, searching a target task in the task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for managing the functional module;
and S3, registering the target function module in the target task under the condition that the target task is found from the task list, and processing the target business event through the target task.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 10 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, and a Mobile Internet Device (MID), a PAD, and the like. Fig. 10 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 10, or have a different configuration than shown in FIG. 10.
The memory 1002 may be used to store software programs and modules, such as program instructions/modules corresponding to the task management method and apparatus in the embodiments of the present invention, and the processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, that is, implementing the task management method. The memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1002 may further include memory located remotely from the processor 1004, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 1002 may be used for storing information such as task running, but not limited to. As an example, as shown in fig. 10, the memory 1002 may include, but is not limited to, an obtaining module 902, a searching module 904, and a registering module 906 in the task management apparatus. In addition, other module units in the task management device may also be included, but are not limited to, and are not described in detail in this example.
Optionally, the above-mentioned transmission device 1006 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1006 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices so as to communicate with the internet or a local area Network. In one example, the transmission device 1006 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In addition, the electronic device further includes: a display 1008 for displaying each task in the task management module; and a connection bus 1010 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations of the task management aspect described above. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, under the condition of receiving a service processing instruction, acquiring a task list currently managed by the task management module, wherein the service processing instruction is used for indicating a target service event to be processed in the target function module;
s2, searching a target task in the task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for managing the functional module;
and S3, registering the target function module in the target task under the condition that the target task is found from the task list, and processing the target business event through the target task.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for task management, comprising:
under the condition of receiving a service processing instruction, acquiring a task list currently managed by a task management module, wherein the service processing instruction is used for indicating that a target service event is processed in a target function module;
searching a target task in the task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for managing a functional module;
and under the condition that the target task is found from the task list, registering the target function module into the target task, and processing the target business event through the target task.
2. The method of claim 1, wherein searching for a target task in the task list according to the established load parameters of each task in the task list comprises:
acquiring load parameters corresponding to the tasks in the task list;
sequentially comparing the load parameter of each task in each task with a target threshold value;
determining the task with the load parameter smaller than the target threshold value as the target task.
3. The method according to claim 1, wherein the obtaining of the load parameter corresponding to each task in the task list comprises:
acquiring an event set and event weights corresponding to the event set, and calculating event parameters;
acquiring the number and the number weight of functional modules registered in the current task, and calculating a number parameter;
and calculating the load parameter according to the event parameter and the quantity parameter.
4. The method of claim 3, wherein the obtaining the event set and the event weight corresponding to the event set comprises:
acquiring an event contained in the current task, and determining an event type corresponding to the event;
classifying the events according to the event types to form the event set;
determining the event weight pre-assigned for the set of events.
5. The method of claim 1, wherein after finding a target task in the task list, the method further comprises:
and under the condition that the target task is not found in the task list, creating the target task in the task management module, registering the target function module in the target task, and processing the target service event through the target task.
6. The method according to claim 1 or 5, wherein the registering the target function module into the target task and the processing the target business event by the target task comprises:
registering the target function module into the target task through a user component, and sending a service processing instruction to the target task;
the target task responds to the service processing instruction and acquires the target service event from the task management module;
and the target task processes the target business event through a functional component.
7. The method of claim 6, wherein registering the target function module with the target task via the user component comprises:
the user component calls the task management module to send a configuration instruction to the target task;
the target task responds to the configuration instruction and determines a target interface for receiving the target function module;
and the target function module transmits the data packet of the target service event to the target task through the target interface so as to register the target function module in the target task.
8. A task management apparatus, comprising:
the system comprises an acquisition module, a task management module and a target function module, wherein the acquisition module is used for acquiring a task list currently managed by the task management module under the condition of receiving a service processing instruction, and the service processing instruction is used for indicating a target service event to be processed in the target function module;
the searching module is used for searching a target task in the task list according to the load parameters of each task established in the task list, wherein the load parameters are used for indicating the load state of the task, and the tasks in the task list are used for managing the functional module;
and the registration module is used for registering the target function module in the target task under the condition that the target task is found from the task list, and processing the target service event through the target task.
9. A computer-readable storage medium comprising a stored program, characterized in that the program when executed performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202110064695.XA 2021-01-18 2021-01-18 Task management method and device, storage medium and electronic equipment Pending CN112667386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110064695.XA CN112667386A (en) 2021-01-18 2021-01-18 Task management method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110064695.XA CN112667386A (en) 2021-01-18 2021-01-18 Task management method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112667386A true CN112667386A (en) 2021-04-16

Family

ID=75415510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110064695.XA Pending CN112667386A (en) 2021-01-18 2021-01-18 Task management method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112667386A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664934A (en) * 2012-04-06 2012-09-12 北京华夏电通科技股份有限公司 Multi-thread control method and system for adaptive self-feedback of server
CN103605568A (en) * 2013-10-29 2014-02-26 北京奇虎科技有限公司 Multithread management method and device
CN106375372A (en) * 2016-08-23 2017-02-01 东方网力科技股份有限公司 Big data resource allocation method and device
WO2017070900A1 (en) * 2015-10-29 2017-05-04 华为技术有限公司 Method and apparatus for processing task in a multi-core digital signal processing system
CN109582301A (en) * 2018-12-03 2019-04-05 深圳前海微众银行股份有限公司 Method for processing business, device, equipment and the medium of task based access control scheduling system
CN110602254A (en) * 2019-10-08 2019-12-20 腾讯科技(深圳)有限公司 Method, device and system for realizing load balance
CN110888719A (en) * 2019-09-18 2020-03-17 广州市巨硅信息科技有限公司 Distributed task scheduling system and method based on web service
CN111736809A (en) * 2020-06-24 2020-10-02 杭州安森智能信息技术有限公司 Distributed robot cluster network management framework and implementation method thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664934A (en) * 2012-04-06 2012-09-12 北京华夏电通科技股份有限公司 Multi-thread control method and system for adaptive self-feedback of server
CN103605568A (en) * 2013-10-29 2014-02-26 北京奇虎科技有限公司 Multithread management method and device
WO2017070900A1 (en) * 2015-10-29 2017-05-04 华为技术有限公司 Method and apparatus for processing task in a multi-core digital signal processing system
CN106375372A (en) * 2016-08-23 2017-02-01 东方网力科技股份有限公司 Big data resource allocation method and device
CN109582301A (en) * 2018-12-03 2019-04-05 深圳前海微众银行股份有限公司 Method for processing business, device, equipment and the medium of task based access control scheduling system
CN110888719A (en) * 2019-09-18 2020-03-17 广州市巨硅信息科技有限公司 Distributed task scheduling system and method based on web service
CN110602254A (en) * 2019-10-08 2019-12-20 腾讯科技(深圳)有限公司 Method, device and system for realizing load balance
CN111736809A (en) * 2020-06-24 2020-10-02 杭州安森智能信息技术有限公司 Distributed robot cluster network management framework and implementation method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
中国通信学会学术工作委员会编, pages: 265 - 269 *

Similar Documents

Publication Publication Date Title
CN115328663B (en) Method, device, equipment and storage medium for scheduling resources based on PaaS platform
CN110365748B (en) Service data processing method and device, storage medium and electronic device
CN108121511B (en) Data processing method, device and equipment in distributed edge storage system
CN111371603A (en) Service instance deployment method and device applied to edge computing
CN105373429A (en) Task scheduling method, device and system
CN110532077B (en) Task processing method and device and storage medium
CN102385536B (en) Method and system for realization of parallel computing
CN112965817B (en) Resource management method and device and electronic equipment
CN112311820A (en) Edge device scheduling method, connection method, device and edge device
CN111352716A (en) Task request method, device and system based on big data and storage medium
CN104660689A (en) Distributed computing system
CN114036031B (en) Scheduling system and method for resource service application in enterprise digital middleboxes
CN110545302A (en) calculation migration method, equipment and storage medium
CN111131040A (en) Route configuration method, device and system, storage medium and electronic device
CN111447143A (en) Business service data transmission method and device, computer equipment and storage medium
CN112667386A (en) Task management method and device, storage medium and electronic equipment
CN112003930A (en) Task allocation method, device, equipment and storage medium
CN108616576B (en) Method and device for scheduling application server
CN104065684A (en) Information processing method, electronic device and terminal device
CN111143033A (en) Operation execution method and device based on scalable operating system
CN112799849B (en) Data processing method, device, equipment and storage medium
CN113504981A (en) Task scheduling method and device, storage medium and electronic equipment
CN115277707A (en) Service processing method, device, electronic equipment and storage medium
CN108733805B (en) File interaction method, system, computer equipment and storage medium
CN113296913A (en) Data processing method, device and equipment based on single cluster and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210416

RJ01 Rejection of invention patent application after publication