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

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

Info

Publication number
CN112925623B
CN112925623B CN202110222825.8A CN202110222825A CN112925623B CN 112925623 B CN112925623 B CN 112925623B CN 202110222825 A CN202110222825 A CN 202110222825A CN 112925623 B CN112925623 B CN 112925623B
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.)
Active
Application number
CN202110222825.8A
Other languages
Chinese (zh)
Other versions
CN112925623A (en
Inventor
蒲勇全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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/CN112925623B/en
Publication of CN112925623A publication Critical patent/CN112925623A/en
Application granted granted Critical
Publication of CN112925623B publication Critical patent/CN112925623B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure discloses a task processing method, device, equipment, medium and 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 task data aiming at least one task to be processed, and the task type of each task to be processed is a designated type; acquiring a program module aiming at a target task to be processed based on task data aiming at 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, device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to the field of cloud computing, and more particularly, to a task processing method, a task processing device, an electronic apparatus, a medium, and a program product.
Background
In the process of processing tasks, the related art generally needs to process a plurality of tasks sequentially, resulting in lower processing efficiency of the tasks. When an abnormality occurs in the task processing process, all the remaining tasks are generally failed to execute, and the stability of the service is affected.
Disclosure of Invention
The present disclosure provides a task processing method, apparatus, electronic device, storage medium, and 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 task data aiming at least one task to be processed, and the task type of each task to be processed is a designated type; acquiring a program module aiming at a target task to be processed based on task data aiming at the target task to be processed; the target task to be processed is processed based on task data for the target task to be processed and program modules for the target task to be processed.
According to another aspect of the present disclosure, there is provided a task processing device 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 task data aiming at least one task to be processed, and the task type of each task to be processed is an appointed type. The second acquisition module is used for acquiring a program module aiming at the target task to be processed based on 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 of the target task to be processed and the program module of 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 task processing method described above.
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 description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 schematically illustrates a system architecture of a task processing method and apparatus according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a task processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a task processing method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of a task processing method according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a schematic diagram of a task data set according to an embodiment of the disclosure;
FIG. 6 schematically illustrates a flow chart of a task processing method according to another embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of a task processing device according to an embodiment of the disclosure; and
Fig. 8 is a block diagram of an electronic device for task processing to implement an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one 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/or 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 should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a convention should be interpreted in accordance with the meaning of one of skill in the art having generally understood the convention (e.g., "a system having at least one of A, B and C" would include, but not be limited to, systems having 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.).
The embodiment of the disclosure provides a task processing method, which comprises the following steps: task data aiming at a target task to be processed is obtained from a task data set, wherein 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 an appointed type. Then, a program module for the target task to be processed is acquired based on task data for the target task to be processed. 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 illustrates 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 embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in 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. The network 104 is the medium used to provide communication links between the clients 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 105 through the network 104 using clients 101, 102, 103 to receive or send messages, etc. Various communication client applications may be installed on clients 101, 102, 103, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, and the like (by way of example only).
The clients 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like. The clients 101, 102, 103 of the disclosed embodiments may, for example, run applications.
The server 105 may be a server providing various services, such as a background management server (by way of example only) that provides support for websites browsed by users using clients 101, 102, 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, 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 cloud computing functionality.
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 devices provided by the embodiments of the present disclosure may be generally disposed in the server 105. The task processing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the clients 101, 102, 103 and/or the server 105. Accordingly, the task processing devices provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the clients 101, 102, 103 and/or the server 105.
For example, the server 105 may begin performing multiple tasks after receiving a trigger instruction from a client 101, 102, 103. In executing a plurality of tasks, task data of each task is acquired for each task, and a task type of each task is determined based on the task data so as to determine to continue executing the task or skip the task according to the task type. Wherein the task data may be obtained from the clients 101, 102, 103, e.g. by the server 105 in real time. 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 implementation.
The embodiment of the present disclosure provides a task processing method, and a task processing method according to an exemplary embodiment of the present disclosure is described below with reference to fig. 2 to 6 in conjunction with the system architecture of fig. 1. The task processing of the embodiments of the present disclosure is performed by, for example, the server 105 shown in fig. 1.
Fig. 2 schematically illustrates a flow chart 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, each task to be processed having a task type of a specified type. Each task to be processed is, for example, a non-urgent task, task data of the task to be processed can be stored in a task data set in advance, and task data of a target task to be processed can be obtained from the task data set later, so that the target task to be processed can be processed based on the task data.
For example, when multiple tasks need to be processed, an urgent task may be processed first, and non-urgent tasks stored for subsequent processing. For example, for each of a plurality of tasks, it is determined whether the task is a non-urgent task. If the task is determined to be an urgent task, the task is processed. If the task is determined to be a non-urgent task, task data for the task may be stored into a task data set.
Illustratively, the plurality of tasks includes, for example, an order task, a payment task, a send message task, an add points task, and the like. In an example, the task type is a send message type and the add points type is a specified type, i.e., the send message task and the add points task are non-urgent tasks.
Next, task data for the target task to be processed may be periodically crawled from the task data set. The target task to be processed is, for example, an executable task in a task data set. The task data includes, for example, relevant parameters required for processing the task. Taking the target task to be processed as a short message sending task as an example, task data for sending the short message service at least comprises related parameters such as a mobile phone number, short message content, sending time and the like, and the sending time comprises time or time period.
After task data of the target task to be processed is acquired, a program module aiming at the target task to be processed is further acquired. The program module comprises logic codes for task processing, and the logic codes are operated to process target tasks to be processed to obtain processing results.
In embodiments of the present disclosure, task data of a target task to be processed may be subsequently extracted from a task data set by adding task data of a non-urgent task to be processed to the task data set in order to process the target task to be processed. For example, a program module for the target task to be processed is acquired based on task data of the target task to be processed, 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 by storing task data of the non-urgent task and processing the non-urgent task later, the processing efficiency of the task is improved. In addition, a timely processing mode is adopted for urgent tasks, and a mode of storing task data for subsequent processing is adopted for non-urgent tasks, so that the flexibility of task processing is improved.
Fig. 3 schematically illustrates a flow chart 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, program modules for each of a plurality of tasks constitute 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 as the program module aiming at the target task to be processed.
For example, the program module set includes a program module for an order task, a program module for a payment task, a program module for a short message sending task, and a program module for an integration increasing task. Taking a program module for a task of sending a short message as an example, a program identifier of the program module is "send short message", for example.
Additionally, task data includes a task identification, which may represent a task type. For example, taking the target task to be processed as a task for sending a short message as an example, the task identifier in the task data for sending the short message is, for example, "sending a short message". Aiming at the target task to be processed as a short message sending task, a program module with a program identifier of 'short message sending' is obtained from a program module set and is used as a program module of the target task to be processed. And then obtaining a processing result based on task data of the target task to be processed by using the program module. For example, the program module is used for processing related parameters in the task data to obtain a processing result. For example, task data for a task of sending a short message, where relevant parameters in the task data include, for example, a mobile phone number, a content of the short message, a sending time, and the like.
According to an embodiment of the present disclosure, before performing operation S301, operations S304 to S311 may be performed, for example.
In operation S304, a trigger instruction for a plurality of tasks is received.
For example, the trigger instruction is initiated by the user, and when the user needs to purchase a certain article, the user initiates a plurality of tasks such as ordering task, payment task, short message sending task, point adding task and the like after ordering. When a trigger instruction for a plurality of tasks is received, processing of the plurality of tasks is started. Among them, the process of processing a plurality of tasks includes performing operations S305 to S310.
In operation S305, task data for a current task is acquired by sequentially taking each of the plurality of tasks as the current task.
In operation S306, it is determined whether the task identification in the task data for the current task indicates that the task type of the current task is a specified type. If yes, operation S307 is performed, and if not, operation S309 is performed.
The task types include, for example, an order task type, a payment task type, a send short trust task type, an add points task type, and the like. In one example, the task type is a send message type and the add points type is a specified type.
In operation S307, in response to the task identification in the task data for the current task indicating that the task type of the current task is a specified type, the current task is determined to be a task to be processed.
In operation S308, task data for a task to be processed is added to the task data set.
When the task type of the current task is the appointed type, the current task is characterized as a non-urgent task, at the moment, the current task can be used as a task to be processed, and task data aiming at the task to be processed are 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, the program module for the current task is acquired from the program module set.
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 appointed type, the current task is characterized as an urgent task, and timely processing is needed. For example, based on the task identifier in the task data of the current task, a program module with the program identifier matched with 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 utilized to process based on the task data for the current task, so as 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 urgent task. The task identifier of the payment task is, for example, "payment", and the program module whose program identifier is "payment" is obtained from the set of program modules based on the task identifier "payment". The task data of 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, and the like by using the acquired program module, and a processing result is obtained.
In operation S311, it is determined whether the current time is a predetermined time. If yes, operation S301 is performed, and if not, operation S311 is returned.
For example, task data for a target task to be processed is periodically acquired from a task data set. The periodic acquisition of task data includes acquisition of task data at a predetermined time, which may be specifically set according to actual application conditions.
In the embodiment of the disclosure, when a plurality of tasks are sequentially processed, whether each task is a non-urgent task is judged, task data of the non-urgent task is stored in a task data set, and the non-urgent task is skipped to preferentially execute urgent tasks in the plurality of tasks, so that processing effectiveness and efficiency of the urgent tasks are guaranteed. In addition, task data are obtained from the task data set regularly to process the task to be processed, so that the processing effectiveness of the non-urgent task is improved to a great extent.
Fig. 4 schematically illustrates 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, packaging and storing the 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 processing program 403 is run by the server, task data is periodically fetched from the database 402 by running the processing program 403, and the corresponding program modules are determined to process the fetched task data.
For example, task a, task b, task c are crawled from database 402 by running handler 403. And determining a 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 embodiments of the present disclosure, the processing program 403 is independent of the main program 401, i.e. the main program 401 and the processing program 403 may run in different servers, for example, thereby improving the concurrent processing capability. In addition, the processing program 403, for example, does not need to process a task, only needs to determine a program module corresponding to the task, and distributes the task to the corresponding program module for processing, thereby improving the processing efficiency of the task.
FIG. 5 schematically illustrates 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 a database in the form of a data table 501. Each task data at least comprises a task identifier, task parameters and state information.
For example, task parameters characterize the relevant parameters needed to process a task to be processed. For example, when the task to be processed is a short message sending task, the task parameters include, for example, a mobile phone number, a short message content, a sending time, and the like. When the task to be processed is to increase the point task, 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 instant or a period of time.
The state information characterizes, for example, a state of the task to be processed, including, 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 set is stored in the database in the form of the data table, so that low-cost storage and high migration of the task data set are realized.
Fig. 6 schematically illustrates a flow chart 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.
Task data for the target task to be processed is periodically grasped from the database in operation S601.
In an embodiment of the present disclosure, the task data in the task data set includes status information. The state information in the task data for the target task to be processed indicates that the state of the target task to be processed is an executable state. That is, task data corresponding to a task to be processed in an executable state may be determined from the task data set as task data of a target task to be processed.
In operation S602, it is determined, for the task parameters in the task data of the captured target task to be processed, whether the current time matches with the time information in the task parameters. If yes, operation S603 is performed, if not, 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) coincide, matching is performed. When the time information in the task parameter is a time period, matching is performed if the current moment falls within the time period.
In operation S603, 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.
That is, the state of the target task to be processed is changed from the executable state to the in-execution state, so as to avoid the target task to be processed being repeatedly processed.
In operation S604, it is determined whether the status information of the target task to be processed indicates that the status of the target task to be processed is an executing status, i.e., whether the status information is successfully modified. If so, operation S605 is performed, if not, exiting.
In operation S605, a target task to be processed is processed based on task parameters for the target task to be processed and program modules for the target task to be processed, resulting in a processing result.
For example, a program module is executed with a task parameter in task data for a target task to be processed as an input of the program module for the target task to be processed to process the target task to be processed.
In embodiments of the present disclosure, the processing results include, for example, successful processing and unsuccessful processing. Unsuccessful processing includes, for example, processing failure and processing timeout.
In operation S606, when the processing result is successful processing, 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 the execution success state.
In operation S607, when the processing result is unsuccessful processing, 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 executable state.
According to the embodiment of the disclosure, after task data of a target task to be processed is captured from a database, 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, so that 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 can be guaranteed to be processed finally by modifying the task state information, and the task is prevented from being omitted.
Fig. 7 schematically illustrates a block diagram of a task processing device according to an embodiment of the present disclosure.
As shown in fig. 7, the task processing device 700 of the embodiment of the present disclosure includes, for example, a first acquisition module 710, a second acquisition module 720, and a processing module 730.
The first obtaining module 710 may be configured to obtain task data for a target task to be processed from a task data set, where the task data set includes task data for at least one task to be processed, and a task type of each task to be processed is a specified type. According to an embodiment of the present disclosure, the first obtaining module 710 may perform, for example, operation S201 described above with reference to fig. 2, which is not described herein.
The second obtaining module 720 may be configured to obtain a program module for the target task to be processed based on task data for the target task to be processed. According to an 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.
The processing module 730 may be configured to process 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. The processing module 730 may, for example, perform operation S203 described above with reference to fig. 2 according to an embodiment of the present disclosure, which is not described herein.
According to an embodiment of the present disclosure, the task data includes a task identification. The apparatus 700 further includes a task processing module for processing a plurality of tasks in response to receiving a trigger instruction for the plurality of tasks before task data for a target task to be processed is obtained from a task data set. The first additional processing module comprises an acquisition sub-module, a determination sub-module and an addition sub-module. The acquisition submodule is used for sequentially taking each task in the plurality of tasks as a current task and acquiring 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 identification in the task data aiming at the current task indicating that the task type of the current task is a designated type. The adding sub-module is used for adding task data aiming at the task to be processed into the task data set.
According to an embodiment of the present disclosure, program modules for each of a plurality of tasks constitute a set of program modules. The apparatus 700 further comprises: a third acquisition module and a second additional processing module. The third acquisition module is used for acquiring the program module aiming at the current task from the program module set in response to the task identification in the task data aiming at the current task indicating that the task type of the current task is not the designated type after acquiring the task data aiming at the current task. The second additional processing module is used 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, from the program module set, a program module with a program identifier matching with the task identifier, based on the task identifier in the task data for the target task to be processed, as the program module for the target task to be processed.
According to an embodiment of the present disclosure, the first obtaining module 710 is further configured to obtain task data for the target task to be processed from the task data set periodically.
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 indicating that the state of the target task to be processed is an executable state for the state information in the task data of the target task to be processed. The apparatus 700 further includes a first modification module configured to modify state information of the target task to be processed after task data for the target task to be processed is obtained from the task data set, so that the modified state information indicates that the state of the target task to be processed is an executing state.
According to an embodiment of the present disclosure, the apparatus 700 further includes a second modification module for modifying 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 sub-module and a second modification sub-module. The first modification submodule is used for modifying the state information of the target task to be processed in response to the successful processing result, so that the modified state information indicates that the state of the target task to be processed is the 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 unsuccessful processing result, 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 the form of a data table.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 8 is a block diagram of an electronic device for task processing to implement an embodiment of the present disclosure.
Fig. 8 illustrates a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present disclosure. 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 telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary 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 computing 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 the bus 804.
Various components in device 800 are connected to I/O interface 805, including: an input unit 806 such as a keyboard, mouse, etc.; 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, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, or the like. 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.
The computing unit 801 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the respective methods and processes described above, such as a task processing method. For example, in some embodiments, the task processing methods may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or communication unit 809. When a computer program is loaded into RAM 803 and executed by 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 circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code 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 code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. 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. The 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 pointing device (e.g., a mouse or 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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 a client and a server. The client and server are typically 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 appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (11)

1. A task processing method, comprising:
processing a plurality of tasks in response to receiving a trigger instruction for the plurality of tasks, wherein program modules for each of the plurality of tasks constitute a set of program modules;
wherein, in the process of processing a plurality of tasks:
Taking each task of the plurality of tasks as a current task in sequence, and acquiring task data aiming at the current task, wherein the task data comprises a task identifier;
Acquiring a program module for a current task from the program module set in response to a task identification in task data for the current task indicating that the task type of the current task is not a specified type;
Processing a current task based on task data for the current task and program modules for the current task;
Determining that the current task is a task to be processed in response to a task identifier in task data for the current task indicating that the task type of the current task is a specified type; and
Adding task data aiming at the task to be processed into a task data set;
Acquiring task data aiming at a target task to be processed from the task data set, wherein 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 designated type;
acquiring a program module aiming at a target task to be processed based on task data aiming at the target task to be processed; and
The target task to be processed is processed based on task data for the target task to be processed and program modules for the target task to be processed.
2. The method of claim 1, wherein each program module in the set of program modules has a program identification; the obtaining the program module for the target task to be processed based on the task data for the target task to be processed comprises the following steps:
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 as the program module aiming at the target task to be processed.
3. The method of claim 1, wherein the obtaining task data for a target task to be processed from a task data set comprises:
task data for a target task to be processed is periodically acquired from the task data set.
4. 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 includes:
And taking task parameters in task data aiming at a target task to be processed as input of a program module of the target task to be processed to execute the program module so as to process the target task to be processed.
5. The method of claim 4, wherein the task data further includes status information in the task data for the target task to be processed indicating that the status of the target task to be processed is an executable status;
the method further comprises, after the task data for the target task to be processed is obtained from the task data set:
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 the executing state.
6. The method of claim 5, further comprising, 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:
And modifying the state information of the target task to be processed based on the processing result.
7. The method of claim 6, 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 the following steps:
modifying the state information of the target task to be processed in response to the successful processing result, so that the modified state information indicates that the state of the target task to be processed is the successful execution state; and
And modifying the state information of the target task to be processed in response to the unsuccessful processing result, so that the modified state information indicates that the state of the target task to be processed is an executable state.
8. The method of any of claims 1-7, wherein the task data set is stored in a data table.
9. A task processing device comprising:
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 task data aiming at least one task to be processed, and the task type of each task to be processed is a designated type;
the second acquisition module is used for acquiring a program module aiming at the target task to be processed based on task data aiming at the target task to be processed; and
A processing module for processing the target task to be processed based on task data for the target task to be processed and a program module for the target task to be processed,
The apparatus further comprises:
the first additional processing module is used for responding to receiving triggering instructions for the tasks before acquiring task data for a target task to be processed from the task data set, and the program modules of each task in the tasks form a program module set;
the first additional processing module includes:
The acquisition sub-module is used for sequentially taking each task in the plurality of tasks as a current task and acquiring task data aiming at the current task, wherein the task data comprises a task identifier;
The determining submodule is used for determining that the current task is a task to be processed in response to the task identification in the task data aiming at the current task indicating that the task type of the current task is a designated type;
The adding sub-module is used for adding the task data aiming at the task to be processed into a task data set;
The third acquisition module is used for acquiring the program module aiming at the current task from the program module set after acquiring the task data aiming at the current task, and responding to the task identification in the task data aiming at the current task to indicate that the task type of the current task is not the appointed type;
The second additional processing module is used for processing the current task based on the task data for the current task and the program module for the current task.
10. An electronic device, comprising:
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 method of any one of claims 1-8.
11. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-8.
CN202110222825.8A 2021-02-26 2021-02-26 Task processing method, device, electronic equipment and medium Active CN112925623B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN112925623A CN112925623A (en) 2021-06-08
CN112925623B true CN112925623B (en) 2024-05-07

Family

ID=76172609

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN112925623B (en)

Families Citing this family (1)

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

Citations (2)

* 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
CN111797862A (en) * 2019-04-09 2020-10-20 Oppo广东移动通信有限公司 Task processing method and device, storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10871989B2 (en) * 2018-10-18 2020-12-22 Oracle International Corporation Selecting threads for concurrent processing of data

Patent Citations (2)

* 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
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
多任务学习;张钰;刘建伟;左信;;计算机学报;20200720(第07期);1340-1378 *

Also Published As

Publication number Publication date
CN112925623A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN114025037B (en) Cloud mobile phone overhaul method and device, electronic equipment and storage medium
CN112965799B (en) Task state prompting method and device, electronic equipment and medium
CN113572833B (en) Cloud mobile phone maintenance method and device, electronic equipment and storage medium
CN112925623B (en) Task processing method, device, electronic equipment and medium
CN112667368A (en) Task data processing method and device
CN114449040B (en) Configuration issuing method and device based on cloud platform
CN114374703B (en) Cloud mobile phone information acquisition method, device, equipment and storage medium
CN114329164B (en) Method, apparatus, device, medium, and article for processing data
CN113535020B (en) Method, apparatus, device, medium and product for generating application icons
CN113010285B (en) Method, apparatus, device, medium, and article for processing data
CN115016955A (en) Method and device for sharing information among multiple applications
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN113239054A (en) Information generation method, related device and computer program product
CN113032040B (en) Method, apparatus, device, medium, and article for processing tasks
CN113312521B (en) Content retrieval method, device, electronic equipment and medium
CN114237752B (en) Push page display method and device, electronic equipment and storage medium
CN114139039B (en) Service stability determination method, device, equipment and storage medium
CN113535187B (en) Service online method, service updating method and service providing method
CN114428646B (en) Data processing method and device, electronic equipment and storage medium
CN114448703B (en) Request processing method, request processing device, electronic equipment and storage medium
CN117041191A (en) Task execution method and device in instant messaging and electronic equipment
CN114416040A (en) Page construction method, device, equipment and storage medium
CN116628306A (en) Webpage resource acquisition method and device, electronic equipment and storage medium
CN117081939A (en) Traffic data processing method, device, equipment 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
GR01 Patent grant
GR01 Patent grant