CN112925623A - Task processing method and device, electronic equipment and medium - Google Patents

Task processing method and device, electronic equipment and medium Download PDF

Info

Publication number
CN112925623A
CN112925623A CN202110222825.8A CN202110222825A CN112925623A CN 112925623 A CN112925623 A CN 112925623A CN 202110222825 A CN202110222825 A CN 202110222825A CN 112925623 A CN112925623 A CN 112925623A
Authority
CN
China
Prior art keywords
task
processed
target
data
processing
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
CN202110222825.8A
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110222825.8A priority Critical patent/CN112925623A/en
Publication of CN112925623A publication Critical patent/CN112925623A/en
Pending legal-status Critical Current

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
    • 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

Abstract

The disclosure discloses a task processing method, a task processing device, a task processing equipment, a task processing medium and a task processing product, and relates to the field of cloud computing. The task processing method comprises the following steps: acquiring task data aiming at a target task to be processed from a task data set, wherein the task data set comprises the task data aiming at least one task to be processed, and the task type of each task to be processed is a specified type; acquiring a program module for the target task to be processed based on the task data for the target task to be processed; and processing the target task to be processed based on the task data for the target task to be processed and the program module for the target task to be processed.

Description

Task processing method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of computer technologies, particularly to the field of cloud computing and the like, and more particularly, to a task processing method, a task processing apparatus, an electronic device, a medium, and a program product.
Background
In the process of processing the task, the related art generally needs to process a plurality of tasks in sequence, resulting in low processing efficiency of the task. When the process of processing tasks is abnormal, all the remaining tasks are usually failed to execute, and the stability of the service is affected.
Disclosure of Invention
The disclosure provides a task processing method, a task processing device, an electronic device, a storage medium and a program product.
According to an aspect of the present disclosure, there is provided a task processing method including: acquiring task data aiming at a target task to be processed from a task data set, wherein the task data set comprises the task data aiming at least one task to be processed, and the task type of each task to be processed is a specified type; acquiring a program module for the target task to be processed based on the task data for the target task to be processed; and processing the target task to be processed based on the task data aiming at the target task to be processed and the program module aiming at the target task to be processed.
According to another aspect of the present disclosure, there is provided a task processing apparatus including: the device comprises a first acquisition module, a second acquisition module and a processing module. The first acquisition module is used for acquiring task data aiming at a target task to be processed from a task data set, wherein the task data set comprises the task data aiming at least one task to be processed, and the task type of each task to be processed is a specified type. The second acquisition module is used for acquiring a program module aiming at the target task to be processed based on the task data aiming at the target task to be processed. The processing module is used for processing the target task to be processed based on the task data aiming at the target task to be processed and the program module aiming at the target task to be processed.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor and a memory communicatively coupled to the at least one processor. Wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the task processing method described above.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the above-described task processing method.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the task processing method described above.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 schematically shows a system architecture of a task processing method and apparatus according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a task processing method according to an embodiment of the present disclosure;
FIG. 3 schematically shows a flow chart of a task processing method according to another embodiment of the present disclosure;
FIG. 4 schematically shows a schematic diagram of a task processing method according to an embodiment of the present disclosure;
FIG. 5 schematically shows a schematic diagram of a task data set according to an embodiment of the present disclosure;
FIG. 6 schematically shows a flow chart of a task processing method according to another embodiment of the present disclosure;
FIG. 7 schematically shows a block diagram of a task processing device according to an embodiment of the present disclosure; and
FIG. 8 is a block diagram of an electronic device for task processing used to implement an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
An embodiment of the present disclosure provides a task processing method, including: task data aiming at a target task to be processed is obtained from a task data set, the task data set comprises the task data aiming at least one task to be processed, and the task type of each task to be processed is a specified type. Then, based on the task data for the target task to be processed, a program module for the target task to be processed is acquired. Next, the target task to be processed is processed based on the task data for the target task to be processed and the program module for the target task to be processed.
Fig. 1 schematically shows a system architecture of a task processing method and apparatus according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include clients 101, 102, 103, a network 104, and a server 105. Network 104 is the medium used to provide communication links between clients 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use clients 101, 102, 103 to interact with server 105 over network 104 to receive or send messages, etc. Various messaging client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (examples only) may be installed on the clients 101, 102, 103.
Clients 101, 102, 103 may be a variety of electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablets, laptop and desktop computers, and the like. The clients 101, 102, 103 of the disclosed embodiments may run applications, for example.
The server 105 may be a server that provides various services, such as a back-office management server (for example only) that provides support for websites browsed by users using the clients 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the client. In addition, the server 105 may also be a cloud server, i.e., the server 105 has a cloud computing function.
It should be noted that the task processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the task processing device provided by the embodiment of the present disclosure may be generally disposed in the server 105. The task processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the clients 101, 102, 103 and/or the server 105. Accordingly, the task processing device provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the clients 101, 102, 103 and/or the server 105.
For example, the server 105 may start executing a plurality of tasks after receiving a triggering instruction from the client 101, 102, 103. In the process of executing a plurality of tasks, task data of each task is acquired and the task type of each task is determined based on the task data, so that the task is determined to be continuously executed or skipped according to the task type. The task data can be obtained from the clients 101, 102, 103 in real time by the server 105, for example. Alternatively, the task data may be stored in advance in a database, and extracted from the database by the server 105.
It should be understood that the number of clients, networks, and servers in FIG. 1 is merely illustrative. There may be any number of clients, networks, and servers, as desired for an implementation.
The embodiment of the present disclosure provides a task processing method, and the following describes a task processing method according to an exemplary embodiment of the present disclosure with reference to fig. 2 to 6 in conjunction with the system architecture of fig. 1. The task processing of the embodiment of the present disclosure is performed by the server 105 shown in fig. 1, for example.
Fig. 2 schematically shows a flowchart of a task processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the task processing method 200 of the embodiment of the present disclosure may include, for example, operations S201 to S203.
In operation S201, task data for a target task to be processed is acquired from a task data set.
In operation S202, a program module for a target task to be processed is acquired based on task data for the target task to be processed.
In operation S203, the target task to be processed is processed based on the task data for the target task to be processed and the program module for the target task to be processed.
For example, the task data set includes task data for at least one task to be processed, and the task type of each task to be processed is a specified type. Each task to be processed is, for example, a non-urgent task, task data of the task to be processed may be stored in the task data set in advance, and subsequently, task data of a target task to be processed may be acquired from the task data set, so as to process the target task to be processed based on the task data.
For example, when a plurality of tasks need to be processed, an urgent task may be processed first, and non-urgent tasks may be stored for subsequent processing. For example, for each task of a plurality of tasks, it is determined whether the task is a non-urgent task. And if the task is determined to be an emergency task, processing the task. If the task is determined to be a non-urgent task, task data for the task may be stored in a task data set.
Illustratively, the plurality of tasks includes, for example, a placing order task, a payment task, a sending short message task, an adding points task, and the like. In one example, the task type is a short message sending type and the point adding type is a designated type, that is, the short message sending task and the point adding task are non-emergency tasks.
Next, task data for the target task to be processed may be periodically fetched from the set of task data. The target pending task is, for example, an executable task in the task data set. The task data includes, for example, relevant parameters required for processing the task. Taking the target task to be processed as the short message sending task as an example, the task data of the short message sending task at least includes related parameters such as a mobile phone number, short message content, sending time and the like, and the sending time includes a moment or a time period, for example.
After the task data of the target task to be processed is obtained, a program module for the target task to be processed is further obtained. The program module contains logic codes for task processing, and the logic codes are executed to process the target task to be processed to obtain a processing result.
In the embodiment of the disclosure, by adding the task data of the non-urgent task to be processed to the task data set, the task data of the target task to be processed can be subsequently extracted from the task data set so as to process the target task to be processed. For example, based on task data of the target task to be processed, a program module for the target task to be processed is acquired, and the target task to be processed is processed based on the task data of the target task to be processed and the program module. It can be understood that the task processing efficiency is improved by storing the task data of the non-urgent tasks and processing the non-urgent tasks in the follow-up process. In addition, a timely processing mode is adopted for an emergency task, and a mode of storing task data for subsequent processing is adopted for a non-emergency task, so that the flexibility of task processing is improved.
Fig. 3 schematically shows a flowchart of a task processing method according to another embodiment of the present disclosure.
As shown in fig. 3, the task processing method 300 of the embodiment of the present disclosure may include, for example, operations S301 to S311.
In operation S301, task data for a target task to be processed is acquired from a task data set.
In operation S302, a program module for a target task to be processed is acquired based on task data for the target task to be processed.
In operation S303, the target task to be processed is processed based on the task data for the target task to be processed and the program module for the target task to be processed.
In an embodiment of the present disclosure, the program module of each of the plurality of tasks constitutes a set of program modules. Each program module in the set of program modules has a program identification. And acquiring a program module with the program identifier matched with the task identifier from the program module set based on the task identifier in the task data aiming at the target task to be processed, and taking the program module as the program module aiming at the target task to be processed.
For example, the program module set comprises a program module for a placing order task, a program module for a payment task, a program module for a sending short message task and a program module for an adding point task. Taking the program module for the task of sending a short message as an example, the program identifier of the program module is, for example, "send a short message".
In addition, task identification is included in the task data, and the task identification can represent a task type. For example, taking the target task to be processed as the short message sending task as an example, the task identifier in the task data of the short message sending task is "send short message". And aiming at the target task to be processed as a short message sending task, acquiring a program module with a program identifier of 'sending short message' from the program module set as the program module of the target task to be processed. And then, a processing result is obtained by utilizing the program module based on the task data of the target task to be processed. For example, the processing result is obtained by processing the relevant parameters in the task data by using the program module. For example, the task data for the task of sending the short message includes, for example, a mobile phone number, short message content, sending time, and the like.
According to an embodiment of the present disclosure, before performing operation S301, for example, operations S304 to S311 may be performed.
In operation S304, a trigger instruction for a plurality of tasks is received.
For example, the triggering instruction is initiated by a user, and when the user needs to purchase a certain article, the user triggers a plurality of tasks such as an order placing task, a payment task, a short message sending task and a point adding task to start execution after placing an order. And starting to process the plurality of tasks after receiving the trigger instructions aiming at the plurality of tasks. Among them, in the process of processing a plurality of tasks, operations S305 to S310 are performed.
In operation S305, each of the plurality of tasks is sequentially taken as a current task, and task data for the current task is acquired.
In operation S306, it is determined whether a task identification in the task data for the current task indicates that the task type of the current task is a specified type. If so, operation S307 is performed, and if not, operation S309 is performed.
The task types include, for example, a placing order task type, a payment task type, a short message sending task type, a point adding task type, and the like. In one example, the task type is a short message sending type and the point adding type is a specified type.
In operation S307, in response to the task identifier in the task data for the current task indicating that the task type of the current task is a specified type, it is determined that the current task is a task to be processed.
In operation S308, task data for the task to be processed is added to the task data set.
When the task type of the current task is the designated type, the current task is characterized as a non-emergency task, and at this time, the current task can be used as a task to be processed, and task data aiming at the task to be processed is added into a task data set.
In operation S309, in response to the task identification in the task data for the current task indicating that the task type of the current task is not the specified type, a program module for the current task is acquired from the set of program modules.
In operation S310, the current task is processed based on the task data for the current task and the program module for the current task.
If the task type of the current task is not the specified type, the current task is represented as an emergency task and needs to be processed in time. For example, based on a task identifier in task data of the current task, a program module with a program identifier matching the task identifier is obtained from the program module set as a program module for the current task, and the program module for the current task is used for processing based on the task data for the current task to obtain a processing result.
For example, if the task type of the current task is a payment task type, the current task is an emergency task. The task identification of the payment task is, for example, "pay", and the program module identified as "pay" is obtained from the collection of program modules based on the task identification "pay". The task data for the payment task includes, for example, at least an account, an amount, and the like. Then, processing is performed based on the account, the amount of money, and the like using the acquired program module, resulting in a processing result.
In operation S311, it is determined whether the current time is a predetermined time. If so, operation S301 is performed, otherwise, operation S311 is returned to.
For example, task data for a target task to be processed is periodically acquired from a task data set. The task data is acquired regularly, and the task data is acquired at a preset time, wherein the preset time can be specifically set according to the actual application condition.
In the embodiment of the disclosure, when a plurality of tasks are processed in sequence, by judging whether each task is a non-urgent task and storing task data of the non-urgent task into a task data set, the non-urgent task is skipped to preferentially execute an urgent task in the plurality of tasks, so as to ensure the processing effectiveness and efficiency of the urgent task. In addition, task data are acquired from the task data set regularly to process the tasks to be processed, and the processing effectiveness of the non-urgent tasks is improved to a greater extent.
Fig. 4 schematically shows a schematic diagram of a task processing method according to an embodiment of the present disclosure.
As shown in fig. 4, the server runs a main program 401 to process a plurality of tasks. And when each task is processed, determining whether each task is a non-urgent task, and if so, encapsulating and storing task data of the non-urgent task into a task data set. The task data set is stored, for example, in database 402. Then, the server runs the processing program 403, periodically fetches task data from the database 402 by running the processing program 403, and determines a corresponding program module to process the fetched task data.
For example, task a, task b, and task c are fetched from the database 402 by running the handler 403. And determining the program module A corresponding to the matched program identification based on the task identification of the task a so as to process the task a through the program module A. Similarly, task B is processed by program module B and task C is processed by program module C.
In the embodiment of the present disclosure, the handler 403 is, for example, independent of the main program 401, that is, the main program 401 and the handler 403 may run in different servers, thereby improving concurrent processing capability. In addition, the processing program 403 only needs to determine the program module corresponding to the task and allocate the task to the corresponding program module for processing, for example, without processing the task, thereby improving the processing efficiency of the task.
FIG. 5 schematically shows a schematic diagram of a task data set according to an embodiment of the disclosure.
As shown in FIG. 5, the task data sets are stored in the database in a data table 501. Each task data at least comprises a task identifier, a task parameter and state information.
For example, the task parameters characterize the relevant parameters needed to process the task to be processed. Illustratively, when the task to be processed is a task of sending a short message, the task parameters include, for example, a mobile phone number, short message content, sending time, and the like. When the task to be processed is a task of adding points, the task parameters include, for example, a point account, a point number, a processing time, and the like. The transmission time (or processing time) includes, for example, a time of day or a time period.
The state information represents, for example, a state of the to-be-processed task, and the state of the to-be-processed task includes, for example, an executing state, an executable state, an execution success state, and the like.
According to the embodiment of the disclosure, the task data sets are stored in the database in a data table mode, and low-cost storage and high migration of the task data sets are achieved.
Fig. 6 schematically shows a flowchart of a task processing method according to another embodiment of the present disclosure.
As shown in fig. 6, the task processing method 600 of the embodiment of the present disclosure may include, for example, operations S601 to S607.
In operation S601, task data for a target task to be processed is periodically fetched from a database.
In an embodiment of the present disclosure, the task data in the task data set includes state information. The state information in the task data for the target to-be-processed task indicates that the state of the target to-be-processed task is an executable state. That is, the task data corresponding to the task to be processed in the executable state may be determined from the task data set as the task data of the target task to be processed.
In operation S602, it is determined whether the current time matches time information in the task parameter for a task parameter in the task data of the captured target task to be processed. If so, operation S603 is performed, otherwise, exiting.
For example, when the time information in the task parameter is the transmission time or the processing time, if the current time and the transmission time (or the processing time) are consistent, the time information is matched. And when the time information in the task parameters is a time period, if the current time falls within the time period, matching.
In operation S603, the state information of the target to-be-processed task is modified, so that the modified state information indicates that the state of the target to-be-processed task is an executing state.
That is, the state of the target to-be-processed task is changed from the executable state to the executing state to avoid the target to-be-processed task from being repeatedly processed.
In operation S604, it is determined whether the state information of the target to-be-processed task indicates that the state of the target to-be-processed task is an executing state, i.e., whether the state information is successfully modified. If so, operation S605 is performed, otherwise, exiting.
In operation S605, the target task to be processed is processed based on the task parameter for the target task to be processed and the program module for the target task to be processed, and a processing result is obtained.
For example, the program module is executed with the task parameters in the task data for the target task to be processed as input of the program module of the target task to be processed to process the target task to be processed.
In an embodiment of the present disclosure, the processing results include, for example, successful processing and unsuccessful processing. Unsuccessful handling includes, for example, handling failures and handling timeouts.
In operation S606, when the processing result is the successful processing, the state information of the target to-be-processed task is modified, so that the modified state information indicates that the state of the target to-be-processed task is the execution successful state.
In operation S607, when the processing result is unsuccessful, the state information of the target to-be-processed task is modified such that the modified state information indicates that the state of the target to-be-processed task is an executable state.
According to the embodiment of the disclosure, after task data for the target task to be processed is captured from the database, the state information of the target task to be processed is modified, so that the modified state information indicates that the state of the target task to be processed is an executing state, and the target task to be processed is prevented from being repeatedly processed. In addition, the state information is modified in real time according to the processing result of the task, and the reliability of task processing is improved. After the task data is stored in the task data set, whether the task processing process is abnormal or not, the task can be guaranteed to be finally processed by modifying the task state information, and the task is prevented from being omitted.
Fig. 7 schematically shows a block diagram of a task processing device according to an embodiment of the present disclosure.
As shown in fig. 7, a task processing device 700 according to an embodiment of the present disclosure includes, for example, a first obtaining module 710, a second obtaining module 720, and a processing module 730.
The first obtaining module 710 may be configured to obtain task data for a target to-be-processed task from a task data set, where the task data set includes task data for at least one to-be-processed task, and a task type of each to-be-processed task is a specified type. According to the embodiment of the present disclosure, the first obtaining module 710 may, for example, perform operation S201 described above with reference to fig. 2, which is not described herein again.
The second obtaining module 720 may be configured to obtain a program module for the target pending task based on the task data for the target pending task. According to the embodiment of the present disclosure, the second obtaining module 720 may, for example, perform the operation S202 described above with reference to fig. 2, which is not described herein again.
The processing module 730 may be configured to process the target pending task based on the task data for the target pending task and the program module for the target pending task. According to the embodiment of the present disclosure, the processing module 730 may, for example, perform operation S203 described above with reference to fig. 2, which is not described herein again.
According to an embodiment of the present disclosure, the task data includes a task identification. The apparatus 700 further comprises a task processing module, and the first additional processing module is configured to process the plurality of tasks in response to receiving a trigger instruction for the plurality of tasks before acquiring task data for a target task to be processed from the task data set. The first additional processing module comprises an acquisition submodule, a determination submodule and an addition submodule. The obtaining submodule is used for sequentially taking each task in the multiple tasks as a current task and obtaining task data aiming at the current task. The determining submodule is used for determining that the current task is a task to be processed in response to the task identifier in the task data for the current task indicating that the task type of the current task is a specified type. And the adding submodule is used for adding the task data aiming at the task to be processed into the task data set.
According to an embodiment of the present disclosure, the program module of each of the plurality of tasks constitutes a set of program modules. The apparatus 700 further comprises: a third acquisition module and a second additional processing module. The third obtaining module is used for obtaining the program module aiming at the current task from the program module set after the task data aiming at the current task is obtained and in response to the task identifier in the task data aiming at the current task indicating that the task type of the current task is not the specified type. The second additional processing module is for processing the current task based on the task data for the current task and the program module for the current task.
According to an embodiment of the present disclosure, each program module in the set of program modules has a program identification. The second obtaining module 720 is further configured to obtain, as a program module for the target task to be processed, a program module whose program identifier matches the task identifier from the program module set based on the task identifier in the task data for the target task to be processed.
According to an embodiment of the present disclosure, the first obtaining module 710 is further configured to periodically obtain task data for the target task to be processed from the task data set.
According to an embodiment of the present disclosure, the task data includes task parameters. The processing module 730 is further configured to execute the program module with the task parameter in the task data for the target task to be processed as an input of the program module of the target task to be processed, so as to process the target task to be processed.
According to an embodiment of the present disclosure, the task data further includes state information, and the state information in the task data for the target to-be-processed task indicates that the state of the target to-be-processed task is an executable state. The apparatus 700 further includes a first modification module, configured to modify the state information of the target to-be-processed task after acquiring the task data for the target to-be-processed task from the task data set, so that the modified state information indicates that the state of the target to-be-processed task is an executing state.
According to an embodiment of the present disclosure, the apparatus 700 further includes a second modification module, configured to modify the state information of the target task to be processed based on the processing result after processing the target task to be processed based on the task data for the target task to be processed and the program module for the target task to be processed.
According to an embodiment of the present disclosure, the processing results include successful processing and unsuccessful processing. The second modification module includes a first modification submodule and a second modification submodule. And the first modification submodule is used for modifying the state information of the target task to be processed in response to the processing result being successful processing, so that the modified state information indicates that the state of the target task to be processed is a successful execution state. And the second modification submodule is used for modifying the state information of the target task to be processed in response to the processing result that the processing result is unsuccessful, so that the modified state information indicates that the state of the target task to be processed is an executable state.
According to an embodiment of the present disclosure, the task data set is stored in a data table.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 8 is a block diagram of an electronic device for task processing used to implement an embodiment of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. The electronic device 800 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 801 executes the respective methods and processes described above, such as the task processing method. For example, in some embodiments, the task processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the task processing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the task processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (14)

1. A method of task processing, comprising:
acquiring task data aiming at a target task to be processed from a task data set, wherein the task data set comprises the task data aiming at least one task to be processed, and the task type of each task to be processed is a specified type;
acquiring a program module for the target task to be processed based on the task data for the target task to be processed; and
and processing the target task to be processed based on the task data aiming at the target task to be processed and the program module aiming at the target task to be processed.
2. The method of claim 1, wherein the task data includes a task identification:
the method further comprises, prior to obtaining task data for the target task to be processed from the set of task data: in response to receiving a trigger instruction for a plurality of tasks, processing the plurality of tasks;
wherein, in the process of processing a plurality of tasks:
taking each task in the plurality of tasks as a current task in sequence, and acquiring task data aiming at the current task;
determining that the current task is a task to be processed in response to the fact that a task identifier in task data for the current task indicates that the task type of the current task is a specified type; and
and adding the task data aiming at the task to be processed into the task data set.
3. The method of claim 2, wherein the program module for each of the plurality of tasks constitutes a set of program modules;
the method further comprises the following steps: after obtaining task data for the current task:
acquiring a program module for the current task from the program module set in response to a task identifier in task data for the current task indicating that the task type of the current task is not a specified type; and
processing the current task based on task data for the current task and a program module for the current task.
4. The method of claim 3, wherein each program module in the set of program modules has a program identification; the acquiring the program module for the target task to be processed based on the task data for the target task to be processed comprises:
and acquiring a program module with a program identifier matched with the task identifier from the program module set based on the task identifier in the task data aiming at the target task to be processed, wherein the program module is used as the program module aiming at the target task to be processed.
5. The method of claim 1, wherein the obtaining task data for a target pending task from a set of task data comprises:
and acquiring task data aiming at the target task to be processed from the task data set regularly.
6. The method of claim 1, wherein the task data includes task parameters; the processing the target task to be processed based on the task data for the target task to be processed and the program module for the target task to be processed comprises:
and taking the task parameters in the task data aiming at the target task to be processed as the input of the program module of the target task to be processed to execute the program module so as to process the target task to be processed.
7. The method of claim 6, wherein the task data further includes state information, the state information in the task data for the target pending task indicating that the state of the target pending task is an executable state;
the method further comprises, after the obtaining task data for a target task to be processed from the set of task data:
and modifying the state information of the target task to be processed, so that the modified state information indicates that the state of the target task to be processed is an executing state.
8. The method of claim 7, further comprising, after processing the target pending task based on task data for the target pending task and a program module for the target pending task:
and modifying the state information of the target task to be processed based on the processing result.
9. The method of claim 8, wherein the processing results include successful processing and unsuccessful processing; the modifying the state information of the target task to be processed based on the processing result comprises:
in response to the processing result being successful processing, modifying the state information of the target task to be processed, so that the modified state information indicates that the state of the target task to be processed is a successful execution state; and
and in response to the processing result being unsuccessful, modifying the state information of the target task to be processed, so that the modified state information indicates that the state of the target task to be processed is an executable state.
10. The method of any of claims 1-9, wherein the set of task data is stored in a data table.
11. A task processing device comprising:
the system comprises a first acquisition module, a first processing module and a second acquisition module, wherein the first acquisition module is used for acquiring task data aiming at a target task to be processed from a task data set, the task data set comprises task data aiming at least one task to be processed, and the task type of each task to be processed is a specified type;
the second acquisition module is used for acquiring a program module aiming at the target task to be processed based on the task data aiming at the target task to be processed; and
and the processing module is used for processing the target task to be processed based on the task data aiming at the target task to be processed and the program module aiming at the target task to be processed.
12. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-10.
13. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-10.
14. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-10.
CN202110222825.8A 2021-02-26 2021-02-26 Task processing method and device, electronic equipment and medium Pending CN112925623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110222825.8A CN112925623A (en) 2021-02-26 2021-02-26 Task processing method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110222825.8A CN112925623A (en) 2021-02-26 2021-02-26 Task processing method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN112925623A true CN112925623A (en) 2021-06-08

Family

ID=76172609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110222825.8A Pending CN112925623A (en) 2021-02-26 2021-02-26 Task processing method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN112925623A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115665369A (en) * 2022-09-09 2023-01-31 北京百度网讯科技有限公司 Video processing method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096344A (en) * 2018-01-29 2019-08-06 北京京东尚科信息技术有限公司 Task management method, system, server cluster and computer-readable medium
US20200125400A1 (en) * 2018-10-18 2020-04-23 Oracle International Corporation Selecting threads for concurrent processing of data
CN111797862A (en) * 2019-04-09 2020-10-20 Oppo广东移动通信有限公司 Task processing method and device, storage medium and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096344A (en) * 2018-01-29 2019-08-06 北京京东尚科信息技术有限公司 Task management method, system, server cluster and computer-readable medium
US20200125400A1 (en) * 2018-10-18 2020-04-23 Oracle International Corporation Selecting threads for concurrent processing of data
CN111797862A (en) * 2019-04-09 2020-10-20 Oppo广东移动通信有限公司 Task processing method and device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张钰;刘建伟;左信;: "多任务学习", 计算机学报, no. 07, 20 July 2020 (2020-07-20), pages 1340 - 1378 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115665369A (en) * 2022-09-09 2023-01-31 北京百度网讯科技有限公司 Video processing method and device, electronic equipment and storage medium
CN115665369B (en) * 2022-09-09 2023-11-03 北京百度网讯科技有限公司 Video processing method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN113867916A (en) Task processing method and device and electronic equipment
CN110766348B (en) Method and device for combining goods picking tasks
CN112911013A (en) Cloud application processing method and device, computer equipment and storage medium
CN109828830B (en) Method and apparatus for managing containers
CN114025037A (en) Cloud mobile phone overhauling method and device, electronic equipment and storage medium
CN113641544A (en) Method, apparatus, device, medium and product for detecting application status
CN112948081A (en) Method, device and equipment for processing task in delayed mode and storage medium
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN112817660A (en) Method, device, equipment and storage medium for expanding small program capacity
CN112965799B (en) Task state prompting method and device, electronic equipment and medium
CN113691937B (en) Method for determining position information, cloud mobile phone and terminal equipment
CN113535020B (en) Method, apparatus, device, medium and product for generating application icons
CN111580882B (en) Application program starting method, device, computer system and medium
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN114265692A (en) Service scheduling method, device, equipment and storage medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN113946816A (en) Cloud service-based authentication method and device, electronic equipment and storage medium
CN112817992A (en) Method, device, electronic equipment and readable storage medium for executing change task
CN112540804A (en) Applet running method and device, electronic equipment and medium
CN112463616A (en) Chaos testing method and device for Kubernetes container platform
CN113590447B (en) Buried point processing method and device
CN113535187B (en) Service online method, service updating method and service providing method
CN110262756B (en) Method and device for caching data

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