CN109542598B - Timed task management method and device - Google Patents

Timed task management method and device Download PDF

Info

Publication number
CN109542598B
CN109542598B CN201811325385.3A CN201811325385A CN109542598B CN 109542598 B CN109542598 B CN 109542598B CN 201811325385 A CN201811325385 A CN 201811325385A CN 109542598 B CN109542598 B CN 109542598B
Authority
CN
China
Prior art keywords
target
execution
timing task
data
state
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
CN201811325385.3A
Other languages
Chinese (zh)
Other versions
CN109542598A (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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201811325385.3A priority Critical patent/CN109542598B/en
Publication of CN109542598A publication Critical patent/CN109542598A/en
Application granted granted Critical
Publication of CN109542598B publication Critical patent/CN109542598B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Abstract

The invention provides a timing task management method and a timing task management device, wherein the method comprises the following steps: determining an execution switch of a target timing task from a first data table, wherein the first data table comprises the execution switch of at least one timing task; judging whether an execution switch of the target timing task is in an on state or not; and if the execution switch of the target timing task is in an on state, executing the target timing task in a second data table corresponding to the target timing task. The timing task management method and the timing task management device can realize the management of different timing tasks through the execution switches of different timing tasks in the first data table without adding instructions to each timing task, thereby improving the management efficiency of the timing task management method.

Description

Timed task management method and device
Technical Field
The present invention relates to the field of data management technologies, and in particular, to a method and an apparatus for managing a timed task.
Background
Most of the current service processing systems, such as network service management systems, have a large number of timing tasks that need to be executed repeatedly at regular time, and these timing tasks are set to be executed at preset time to obtain service data at preset time or to implement service processing at preset time. In the prior art, in order to manage the timing tasks, corresponding time is set in each timing task in the system, and usually, a developer or a maintainer of the system adds an instruction form into a program code of the timing task, so that the system executes the timing task at preset time according to the instruction in the timing task.
However, when the number of the timing tasks in the system is large, a developer or a maintainer needs to add an instruction to each timing task, so that different timing tasks can be executed at preset time according to the instruction, and thus, a large amount of workload for managing the timing tasks is brought to the developer or the maintainer, and the management efficiency of the timing task management method in the prior art is low.
Disclosure of Invention
The invention provides a timed task management method and a timed task management device, which improve the management efficiency of a timed task method.
The first aspect of the present invention provides a method for managing a timed task, including:
determining an execution switch of a target timing task from a first data table, wherein the first data table comprises the execution switch of at least one timing task;
judging whether an execution switch of the target timing task is in an on state;
and if the execution switch of the target timing task is in an on state, processing the target timing task in a second data table corresponding to the target timing task.
In an embodiment of the first aspect of the present invention, after the target timing task is executed in the second data table corresponding to the target timing task, the method further includes:
and determining whether to process the target data in the second data table according to the execution condition of the target timing task.
In an embodiment of the first aspect of the present invention, the determining whether to process the target data in the second data table according to the execution condition of the target timing task includes:
adjusting the execution state of the target data recorded in the second data table according to the execution condition of the target timing task;
and when the execution state of the target data is an executable state, determining to process the target data.
In an embodiment of the first aspect of the present invention, the execution condition of the target timed task includes at least one of the following:
the execution time, the execution times and the duration of the target timing task and whether the target timing task is executed successfully or not.
In an embodiment of the first aspect of the present invention, the writing time, the updating time, and the processing result of the target data are further recorded in the second data table.
In the first embodiment of the first aspect of the present invention, when all the data in the second data table meet the execution condition of the target timing task, for the target data that is not executed, the write time is set to be the current time for representing the time when the target data is written into the second data table, the update time is set to be the same as the write time, the processing result is set to be null, and the execution state is set to be the executable state;
when the data part in the second data table meets the execution condition of the target timing task, setting the writing time as the time when the target data meets the execution condition of the target timing task, setting the updating time as the same as the writing time, setting the processing result as null, and setting the execution state as an executable state for the target data which is not executed;
when part or all of the data recorded in the second data table meets the execution condition of the target timing task, selecting the target data of which the execution state is the executable state to process, wherein if the target data is successfully executed, the updating time is set as the time for executing the target data, the processing result is set to represent that the target data is successfully executed, the execution state is set as the non-executable state, if the target data is not successfully executed after being executed, the updating time is set as the time for executing the target data, the processing result is set to represent that the target data is not successfully executed, and the execution state is adjusted according to the execution condition of the target timing task.
In an embodiment of the first aspect of the present invention, the adjusting the execution state of the target data recorded in the second data table according to the execution condition of the target timing task includes:
and if the time for processing the target timing task is later than the preset time, adjusting the execution state of the target data to be an unexecutable state.
In an embodiment of the first aspect of the present invention, the adjusting the execution state of the target data recorded in the second data table according to the execution condition of the target timing task includes:
and if the processing times of the target data are greater than the preset times, adjusting the execution state of the target data to be a non-executable state.
In an embodiment of the first aspect of the present invention, the adjusting the execution state of the target data recorded in the second data table according to the execution condition of the target timing task includes:
acquiring a processing instruction of target data;
and adjusting the execution state of the target data according to the processing instruction.
A second aspect of the present invention provides a timed task management apparatus, including:
the device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for determining an execution switch of a target timing task from a first data table, and the first data table comprises the execution switch of at least one timing task;
the judging module is used for judging whether an execution switch of the target timing task is in an on state;
and the processing module is used for executing the target timing task in a second data table corresponding to the target timing task if the execution switch of the target timing task is judged to be in an on state.
In an embodiment of the second aspect of the present invention, the timed task management device further includes: and the second determining module is used for determining whether to process the target data in the second data table according to the execution condition of the target timing task.
In an embodiment of the second aspect of the present invention, the second determining module is specifically configured to adjust an execution state of the target data recorded in the second data table according to an execution condition of the target timing task;
and when the execution state of the target data is an executable state, determining to process the target data.
In an embodiment of the second aspect of the present invention, the execution condition of the target timed task includes at least one of the following: the execution time, the execution times and the duration of the target timing task and whether the target timing task is executed successfully or not.
In an embodiment of the second aspect of the present invention, the writing time, the updating time, and the processing result of the target data are also recorded in the second data table.
In an embodiment of the second aspect of the present invention, when all the data in the second data table meet the execution condition of the target timing task, for the target data that is not executed, the write time is set to be the current time for representing the time when the target data is written into the second data table, the update time is set to be the same as the write time, the processing result is set to be null, and the execution state is set to be the executable state;
when the data part in the second data table meets the execution condition of the target timing task, setting the writing time as the time when the target data meets the execution condition of the target timing task, setting the updating time as the same as the writing time, setting the processing result as null, and setting the execution state as an executable state for the target data which is not executed;
when part or all of the data recorded in the second data table meets the execution condition of the target timing task, selecting the target data of which the execution state is the executable state to process, wherein if the target data is successfully executed, the updating time is set as the time for executing the target data, the processing result is set to represent that the target data is successfully executed, the execution state is set as the non-executable state, if the target data is not successfully executed after being executed, the updating time is set as the time for executing the target data, the processing result is set to represent that the target data is not successfully executed, and the execution state is adjusted according to the execution condition of the target timing task.
In an embodiment of the second aspect of the present invention, the second determining module is specifically configured to adjust the execution state of the target data to be an unexecutable state if the time for processing the target timing task is later than a preset time.
In an embodiment of the second aspect of the present invention, the second determining module is specifically configured to adjust the execution state of the target data to be an unexecutable state if the processing frequency of the target data is greater than a preset frequency.
In an embodiment of the second aspect of the present invention, the second determining module is specifically configured to obtain a processing instruction of the target data; and adjusting the execution state of the target data according to the processing instruction.
A third aspect of the present invention provides a computer storage medium having stored thereon a computer program which, when executed, implements the timed task management method of any one of the above embodiments.
A fourth aspect of the present invention provides an electronic apparatus comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the timed task management method of any of the above embodiments via execution of the executable instructions.
In summary, in the method and apparatus for managing timed tasks provided by the present invention, an execution switch of a target timed task is determined from a first data table, where the first data table includes at least one execution switch of a timed task; judging whether an execution switch of the target timing task is in an on state or not; and if the execution switch of the target timing task is in an on state, processing the target timing task in a second data table corresponding to the target timing task. Therefore, the timed task management method and the timed task management device provided by the invention can realize the management of different timed tasks through the execution switches of different timed tasks in the first data table without adding instructions to each timed task, thereby improving the management efficiency of the timed task management method.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for managing a timed task according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for managing timed tasks according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for managing timed tasks according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for managing timed tasks according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for managing timed tasks according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a method for managing timed tasks according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a timed task management apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a timed task management apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a flowchart illustrating a timed task management method according to an embodiment of the present invention. As shown in fig. 1, the method for managing a timed task according to this embodiment includes:
s101: and determining an execution switch of the target timing task from a first data table, wherein the first data table comprises the execution switch of at least one target timing task.
S102: and judging whether the execution switch of the target timing task is in an on state or not.
S103: if the execution switch of the target timing task is judged to be in the on state in the S102, executing the target timing task in a second data table corresponding to the target timing task; if the execution switch of the target timing task is judged to be in the off state in the S102, the target timing task is not executed.
The execution subject of the embodiment may be an electronic device with a data processing function, such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, or a server, which is configured as a management apparatus and manages the timed task in the business system or other functional systems by the above-mentioned timed task management method.
Specifically, in the present embodiment, all the target timing tasks in the system managed by the electronic device as the management apparatus are provided with an execution switch for determining whether to execute and process the target timing task according to the execution condition of the target timing task. For example: if a certain target timing task is "data amount newly added to the main data table within one day in the 0-point-per-day statistical system", the electronic device first determines the state of the execution switch of the target timing task when the time to execute the target timing task is before 0 point, for example, before 1 minute before 0 point, if the state of the execution switch is in an on state, it is determined that the target timing task is executed at 0 point time that satisfies the execution condition of the target timing task, and if the state of the execution switch is in an off state, the target timing task is not executed even if the time reaches 0 point and satisfies the execution condition of the target timing task.
Optionally, the execution switch of the target timing task in this embodiment is represented by a parameter, for example, when the parameter of the execution switch is 1, the execution switch is in an on state, and when the parameter of the execution switch is 0, the execution switch is in an off state. And the parameters of the execution switches of the target timed task are independent of the program code of the target timed task itself. For example, one possible way is that, if the operation corresponding to a certain target timing task is a statistical operation of data in the second data table, a first data table is newly created outside the second data table in the system for storing parameters of the execution switch, so that the management device or the user can control whether the target timing task is executed in the corresponding second data table by modifying the state of the parameters of the execution switch of the target timing task in the first data table. Therefore, the adjustment of the execution switch of the target timing task is independent of the program code of the target timing task, and the target timing task can be adjusted to be executed or not and immediately take effect after being directly modified without adjusting the code of the target timing task or restarting the whole system.
In addition, the first data table may also be used to store parameters of the execution switches of all the target timing tasks in the system, and the management device determines the state of the execution switch of each target timing task in the first data table before executing each target timing task. Similarly, the management device may directly modify the state of the execution switch of each target timing task in the first data table to control whether to execute the target timing task. In addition, a developer or a maintainer of the system can directly operate and adjust the parameters of the execution switch of the target timing task through an interactive interface provided by the management device.
In summary, in the management method for the timed task provided in this embodiment, the execution switch of the target timed task is determined from the first data table, and whether the execution switch of the target timed task is in an on state is determined. And if the execution switch of the target timing task is in an on state, processing the target timing task in a second data table corresponding to the target timing task. Therefore, management of different target timing tasks can be achieved through an execution switch of the target timing task independent of the target timing task, and instructions do not need to be added into each target timing task, so that the target timing tasks in the system can be managed in a unified mode, the target timing tasks in the system can be expanded and adjusted conveniently, and the management efficiency of the management method of the target timing tasks is improved.
Fig. 2 is a flowchart illustrating a method for managing a timed task according to an embodiment of the present invention. The method shown in fig. 2 further includes, after S103 based on the embodiment in fig. 1: s104: and determining whether to execute the target data in the second data table according to the execution condition of the target timing task.
In this embodiment, a field for managing target data in the second data table is added to the second data table that needs to be processed for determining the target timing task, so as to specifically perform management of the operation mode and fault tolerance processing on the target data that needs to be processed for the target timing task.
Specifically, in the present embodiment, the four fields added to the data table to be processed by the target timed task are the write time, the update time, the execution result, and the execution state of the target data. Writing time refers to the time when data in a data table to be processed by the target timing task meets the execution condition of the target timing task; the updating time refers to the time of task execution when the target is updated, and the initial value of the updating time is the same as the writing time; the execution result refers to a processing result of the data in the data table to be processed after the target timing task is finished, and the execution result can be success or failure; the execution state refers to whether data in a data table to be processed by the target timing task needs to be executed or not, the target data needs to be executed when the execution state is an executable state, and the target data does not need to be executed when the execution state is an unexecutable state.
The target data may be data related to the target timed task in a data table to be processed by any target timed task. Specifically, as for the execution state of the target data, when the target data in the data table to be processed by the target timing task meets the execution condition of the target timing task, the execution state of the target data is an executable state; when the target data in the data table to be processed by the target timing task does not meet the execution condition of the target timing task, the execution state of the target data is an unexecutable state.
Then, for any specific target data in the second data table corresponding to the target timing task in the above example, S104 specifically includes: when the target data meets the execution condition of the target timing task, adjusting the execution state of the target data to be an executable state; and when the target data does not meet the execution condition of the target timing task, adjusting the execution state of the target data to be a non-executable state. After the execution states of all the data in the second data table are adjusted, when the target data corresponding to the target timing task is executed, whether the target data is executed or not can be determined according to the execution states of the target data.
Further, according to different characteristics of data in the main data table which needs to be processed by different target timing tasks, the target timing tasks can be divided into the following two types: 1. all data in a main data table which needs to be processed by the target timing task all accord with the execution condition of the target timing task; 2. and in the second type of target timing task, part of data in the main data table which needs to be processed by the target timing task accords with the execution condition of the target timing task, but the other part of data does not accord with the execution condition of the target timing task. When the target timing task management method in the embodiment is adopted to process the two types of target timing tasks, the implementation mode and principle of the execution switch of the target timing task are the same; however, when the above two types of target timed tasks are processed by the target timed task management method in the above embodiment, different management and processing methods exist for the two different types of target timed tasks with respect to the write time, update time, execution result, and execution state of the target data recorded in the data table to be processed by the target timed task, and will be described below.
Specifically, for a first type of target timing task, that is, when all data recorded in the second data table meet the execution condition of the target timing task, for unexecuted target data, the writing time is the current time when the target data is written into the second data table, the updating time is the same as the writing time, the processing result is empty, and the execution state is an executable state; when the target data is successfully executed, updating the time to be the time for executing the target data, wherein the processing result is used for representing that the target data is successfully executed, and the execution state is a non-executable state; and when the target data is not successfully executed after being executed, updating the time to be the time for executing the target data, wherein the processing result is used for indicating that the target data is not successfully executed, and the execution state is adjusted according to the execution condition of the target timing task.
For a second type of target timing task, namely when the data part recorded in the second data table meets the execution condition of the target timing task, for unexecuted target data, the writing time is the current time for writing the target data into the second data table, the updating time is the same as the writing time, the processing result is empty, and the execution state is an executable state; if the target data is successfully executed, updating the time to be the time for executing the target data, wherein the processing result is used for representing that the target data is successfully executed and the execution state is a non-executable state; and if the target data is not successfully executed after being executed, updating the time to be the time for executing the target data, wherein the processing result is used for indicating that the target data is not successfully executed, and the execution state is adjusted according to the execution condition of the target timing task.
Fig. 3 is a flowchart illustrating a first type of target timing task according to an embodiment of the timing task management method of the present invention, and is illustrated in fig. 3, wherein all data in the main data table meet the execution condition of the target timing task.
Specifically, before the target timing task is executed, it is required to first determine whether an execution switch of the target timing task is in an on state, and if the execution switch of the target timing task is not on, the process is directly ended;
when the execution switch of the target timing task is in an on state, whether target data with an executable execution state exists in a main data table corresponding to the target timing task is judged (namely whether the execution state of the target data is judged to be the executable state), if the main data table does not have the target data with the executable execution state, the process is directly ended, and if the main data table has the target data with the executable execution state, the target data with the executable execution state of the target data in the target timing task is executed.
If the target timing task is successfully executed, for all target data successfully executed in the target timing task, the update time of the target data is set as the current time, the execution result is set as the success, and the execution state of the target data is set as the non-executable state.
If the target timing task is not successfully executed, for the target data that is not successfully executed in the target timing task, the execution state of the target data needs to be adjusted according to the execution condition of the timing task, for example, the following three adjustment methods:
1. for target data whose execution is stopped at a fixed point in time (e.g., data written on the day whose execution is stopped at 24 points per day), as shown in fig. 3, when it is judged that the target data is successfully executed, the execution state of the target data is adjusted to the non-executable state, and at the same time, the update time is adjusted to the current time, and the execution result is set to be successful. And when the target data is judged to fail to be executed, adjusting the updating time to the current time, setting the execution result as failure, and further judging whether the target data stops at a fixed time point, for example, whether the current time is compared to be 24 points. If the target data is judged to stop at a fixed time point, further judging whether the next execution time of the target data meets the requirement of the stop time; if so, adjusting the execution state of the target data to be a non-executable state, otherwise, adjusting the execution state of the target data to be an executable state. And if the target data is not stopped at a fixed time point, stopping after the target data is executed for a certain time or for a certain number of times, further judging whether the target data meets the condition of stopping execution, if so, adjusting the execution state of the target data to be in an unexecutable state, and otherwise, adjusting the execution state of the target data to be in an executable state.
2. For target data that is executed for a fixed time or a fixed number of times and then is stopped (for example, each target data is executed for 5 times at most and then is stopped, or is executed for 3 days at most and then is stopped), as in the embodiment shown in fig. 6, when it is determined that the target data is successfully executed, the update time is adjusted to the current time, the execution result is set to be successful, and the execution state of the target data is adjusted to be in the non-executable state; when the target data is judged to be not successfully executed, adjusting the updating time to be the current time, setting the execution result to be failure, further judging whether the difference between the current time and the writing time recorded by the target data is more than or equal to 3 days, and if so, adjusting the execution state of the target data to be the unexecutable state; if not, the execution state of the target data is adjusted to be an executable state.
3. The target data may also be determined to be in an executable state or a non-executable state according to the execution instruction by acquiring the execution instruction of the user. The user can be a maintainer or a developer of the target timing task management system, and sends an execution instruction through an interactive interface of a device for managing the target timing task by the user so as to adjust the execution state of the target data.
Fig. 4 is a flowchart illustrating a method for managing a timed task according to an embodiment of the present invention. Fig. 4 is a flowchart illustrating the above process based on the embodiment shown in fig. 3, taking a specific target timing task as an example. As shown in fig. 4, for a certain target timing task a, the execution frequency is executed once every two hours, and for target data in which the execution fails in the target timing task, a fixed time point is adopted to stop the execution, such as: the target data is repeatedly executed for at most two days and at least one day. I.e., data that began execution on the first day, and stopped execution at the latest 24 o' clock on the second day. Specifically, as shown in fig. 4, the steps before determining whether the target timing task is successfully executed are the same as those in the embodiment shown in fig. 3, and if it is determined that the target timing task is failed to be executed, in this embodiment, it needs to specifically determine whether the next execution time of the target data is less than or equal to 24 points of the next day of the write time, if not, the execution state of the target data is adjusted to be the non-executable state and the process is ended, and if so, the execution state of the target data is adjusted to be the executable state and the process is ended.
Fig. 5 is a flowchart of an embodiment of a timed task management method according to the present invention, and is described with reference to fig. 5 for a second type of target timed task, where a part of data in a main data table that needs to be processed by the target timed task meets an execution condition of the target timed task, but another part of data does not meet the execution condition of the target timed task. Specifically, before the target timing task is executed, it is necessary to determine whether target data in a main data table corresponding to the target timing task satisfies an execution condition of the target timing task, if so, the writing time of the target data is current time, the updating time is current time, the execution state is an executable state, and the execution result is empty, and if not, the determination of the target data in the target timing task is finished.
Fig. 6 is a flowchart illustrating a method for managing a timed task according to an embodiment of the present invention. Fig. 6 is a flowchart illustrating the above process based on the embodiment shown in fig. 3, taking a specific target timing task as an example. As shown in fig. 6, for a certain target timing task B, the execution frequency is once per day, and for the target data whose execution fails, the execution is stopped after the target data is executed for a fixed time/number of times, such as: the target data is executed for a maximum of 3 days, and since the execution frequency is once per day, the target data is executed for a maximum of 3 times. Specifically, as shown in fig. 6, the steps before determining whether the target timing task is successfully executed are the same as those in the embodiment shown in fig. 3, and if it is determined that the target timing task is failed to be executed, in this embodiment, it is further specifically determined whether the update time of the target data minus the write time of the target data is greater than or equal to 3 days, otherwise, the parameter of the execution state of the target data is adjusted to be in the non-executable state and the process is ended, and if so, the parameter of the execution state of the target data is adjusted to be in the executable state and the process is ended.
In summary, in the management method for the timed task provided in this embodiment, target data in the main data table corresponding to the target timed task can be recorded, and four added fields respectively record write time, update time, execution result, and execution state of the target data, so as to flexibly process each piece of target data. And the execution switch of the target timing task is combined to carry out unified management on the target timing task together, and the target data of the target timing task is flexibly processed so as to meet various processing rules. Whether the target data continues to be executed or not can be determined according to the recorded execution times, execution duration, execution time points and the like, and a mode of manually stopping the execution of the target data can be provided in a mode of receiving user instructions, so that the management efficiency of the target timing task is further improved.
FIG. 7 is a schematic structural diagram of a timed task management apparatus according to an embodiment of the present invention. As shown in fig. 7, the timed task management apparatus provided in this embodiment includes: a first determining module 701, a judging module 702 and a processing module 703. The first determining module 701 is configured to determine an execution switch of a target timing task from a first data table, where the first data table includes at least one execution switch of the timing task; the judging module 702 is configured to judge whether an execution switch of the target timing task is in an on state; the processing module 703 is configured to execute the target timing task in the second data table corresponding to the target timing task if it is determined that the execution switch of the target timing task is in an on state.
The timed task management device provided in this embodiment may be used to execute the timed task management method shown in fig. 1, and the specific implementation manner and principle thereof are the same, and are not described again.
FIG. 8 is a schematic structural diagram of a timed task management apparatus according to an embodiment of the present invention. The timed task management apparatus shown in fig. 8 is the apparatus shown in fig. 7, and further includes: a second determination module 801. The second determining module 801 is configured to determine whether to execute the target data in the second data table according to the execution condition of the target timing task.
The timed task management device provided in this embodiment may be used to execute the timed task management method shown in fig. 2, and the specific implementation manner and principle thereof are the same, and are not described again.
Optionally, the second determining module 801 is specifically configured to adjust an execution state of the target data recorded in the second data table according to the execution condition of the target timing task; and determining whether to execute the target data according to the execution state of the target data.
Optionally, the execution condition of the target timing task at least includes: the execution time, the execution times and the duration of the target timing task and whether the target timing task is successfully executed.
Optionally, the writing time, the updating time and the execution result of the target data are also recorded in the second data table.
Optionally, when all the data recorded in the second data table meet the execution condition of the target timing task, for the target data that is not executed, the writing time is used to indicate the time when the target data meets the execution condition of the target timing task, the updating time is the same as the writing time, the processing result is empty, and the execution state is an executable state;
when the data part recorded in the second data table accords with the execution condition of the target timing task, for unexecuted target data, the writing time is the time when the target data meets the execution condition of the target timing task, the updating time is the same as the writing time, the processing result is empty, and the execution state is an executable state;
when part or all of the data recorded in the second data table meets the execution condition of the target timing task, if the target data is successfully executed, the updating time is the time for executing the target data, the processing result is used for indicating that the target data is successfully executed, and the execution state is the non-executable state;
when part or all of the data recorded in the second data table meets the execution condition of the target timing task, if the target data is not executed successfully after the execution, the updating time is the time for executing the target data, the processing result is used for indicating that the target data is not executed successfully, and the execution state is adjusted according to the execution condition of the timing task.
Optionally, the second determining module 801 is specifically configured to, if the time for executing the target timing task is later than the preset time, adjust the execution state of the target data to be an unexecutable state.
Optionally, the second determining module 801 is specifically configured to, if the execution time of the target data is greater than the preset time, adjust the execution state of the target data to be an unexecutable state.
Optionally, the second determining module 801 is specifically configured to obtain an execution instruction of the target data; and adjusting the execution state of the target data according to the execution instruction.
The timed task management device provided in this embodiment may be used to execute the timed task management methods in the foregoing embodiments, and the specific implementation manner and principle thereof are the same, and are not described again.
It should be noted that the division of the modules in the embodiments of the present application is schematic, and is only one division of logic functions, and there may be another division manner in actual implementation. Each functional module in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The present application also provides a computer readable storage medium having stored therein program code which, when executed, performs the timed task management method as in any one of the above embodiments.
The present application also provides a computer program product comprising program code that, when executed by a processor, implements the method of timed task management as in any one of the above embodiments.
The application also provides an electronic device, which comprises a processor and a memory, wherein the memory is used for storing the executable instruction of the processor; wherein the processor is configured to perform the timed task management method as described in any of the above embodiments via execution of the executable instructions.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. A timed task management method is characterized by comprising the following steps:
determining an execution switch of a target timing task from a first data table, wherein the first data table comprises the execution switch of at least one timing task; the parameters of the execution switch of the target timing task are independent of the program code of the target timing task;
judging whether an execution switch of the target timing task is in an on state;
if the execution switch of the target timing task is in an on state, executing the target timing task in a second data table corresponding to the target timing task;
and determining whether to process the target data in the second data table according to the execution condition of the target timing task.
2. The method of claim 1, wherein the determining whether to process the target data in the second data table according to the execution condition of the target timed task comprises:
adjusting the execution state of the target data according to the execution condition of the target timing task;
and when the execution state of the target data is an executable state, determining to process the target data.
3. The method of claim 2, wherein the execution condition of the target timed task comprises at least one of:
the execution time, the execution times and the duration of the target timing task and whether the target timing task is executed successfully or not.
4. The method of claim 3,
and the writing time, the updating time and the processing result of the target data are also recorded in the second data table.
5. The method of claim 4,
when all the data in the second data table meet the execution condition of the target timing task, setting the writing time as the current time for representing the target data to be written into the second data table, setting the updating time as the same as the writing time, setting the processing result as null, and setting the execution state as an executable state for the target data which is not executed;
when the data part in the second data table meets the execution condition of the target timing task, setting the writing time as the time when the target data meets the execution condition of the target timing task, setting the updating time as the same as the writing time, setting the processing result as null, and setting the execution state as an executable state for the target data which is not executed;
when part or all of the data recorded in the second data table meets the execution condition of the target timing task, selecting the target data of which the execution state is the executable state to process, wherein if the target data is successfully executed, the updating time is set as the time for executing the target data, the processing result is set to represent that the target data is successfully executed, the execution state is set as the non-executable state, if the target data is not successfully executed after being executed, the updating time is set as the time for executing the target data, the processing result is set to represent that the target data is not successfully executed, and the execution state is adjusted according to the execution condition of the target timing task.
6. The method according to any one of claims 2-5, wherein said adjusting the execution state of the target data according to the execution condition of the target timed task comprises:
if the time for processing the target timing task is later than the preset time, adjusting the execution state of the target data to be an unexecutable state; alternatively, the first and second electrodes may be,
if the processing times of the target data are greater than the preset times, adjusting the execution state of the target data to be a non-executable state; alternatively, the first and second electrodes may be,
and acquiring a processing instruction of the target data, and adjusting the execution state of the target data according to the processing instruction.
7. A timed task management apparatus, comprising:
the device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for determining an execution switch of a target timing task from a first data table, and the first data table comprises the execution switch of at least one timing task; the parameters of the execution switch of the target timing task are independent of the program code of the target timing task;
the judging module is used for judging whether an execution switch of the target timing task is in an on state;
the processing module is used for executing the target timing task in a second data table corresponding to the target timing task if the execution switch of the target timing task is judged to be in an on state;
and the second determining module is used for determining whether to execute the target data in the second data table according to the execution condition of the target timing task.
8. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the timed task management method of any one of claims 1 to 6.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the timed task management method of any of claims 1 to 6 via execution of the executable instructions.
CN201811325385.3A 2018-11-08 2018-11-08 Timed task management method and device Active CN109542598B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811325385.3A CN109542598B (en) 2018-11-08 2018-11-08 Timed task management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811325385.3A CN109542598B (en) 2018-11-08 2018-11-08 Timed task management method and device

Publications (2)

Publication Number Publication Date
CN109542598A CN109542598A (en) 2019-03-29
CN109542598B true CN109542598B (en) 2021-03-16

Family

ID=65844663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811325385.3A Active CN109542598B (en) 2018-11-08 2018-11-08 Timed task management method and device

Country Status (1)

Country Link
CN (1) CN109542598B (en)

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009237858A (en) * 2008-03-27 2009-10-15 Chugoku Electric Power Co Inc:The Server task management program and server task management method
CN105653362A (en) * 2015-12-23 2016-06-08 北京奇虎科技有限公司 Method and equipment for managing timed tasks
CN106201672B (en) * 2016-06-22 2020-05-12 武汉斗鱼网络科技有限公司 Timed task setting system and timed task running method thereof
CN106406993B (en) * 2016-09-06 2019-11-15 努比亚技术有限公司 A kind of timing task management method and system
CN106775620B (en) * 2016-11-14 2020-05-12 武汉斗鱼网络科技有限公司 Timing method and device
CN108255596A (en) * 2016-12-28 2018-07-06 福建省天奕网络科技有限公司 A kind of method and system for performing timed task
CN107885600A (en) * 2017-10-19 2018-04-06 用友网络科技股份有限公司 Dispatching method, device and the computer equipment of batch timed task
CN108334614B (en) * 2018-02-07 2020-11-24 中国平安人寿保险股份有限公司 Data updating method, system and storage medium
CN108762911A (en) * 2018-06-13 2018-11-06 平安科技(深圳)有限公司 Timing task management method, apparatus, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109542598A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN108369544B (en) Deferred server recovery in a computing system
CN107066300B (en) Firmware upgrading method of storage device and storage device
CN110162344B (en) Isolation current limiting method and device, computer equipment and readable storage medium
CN115658098A (en) Upgrading method and device for distributed business processing system
CN110046100B (en) Packet testing method, electronic device and medium
CN116954685B (en) Gray scale rolling upgrading method, system, equipment and medium for low-code application system
CN112598529B (en) Data processing method and device, computer readable storage medium and electronic equipment
US10127270B1 (en) Transaction processing using a key-value store
CN111078418B (en) Operation synchronization method, device, electronic equipment and computer readable storage medium
CN113157491A (en) Data backup method and device, communication equipment and storage medium
CN109542598B (en) Timed task management method and device
CN111880910A (en) Data processing method and device, server and storage medium
US20220229689A1 (en) Virtualization platform control device, virtualization platform control method, and virtualization platform control program
CN107958414B (en) Method and system for eliminating long transactions of CICS (common integrated circuit chip) system
CN114553859A (en) BMC configuration management method and device, electronic equipment and storage medium
US20210110005A1 (en) License management apparatus, license management method, and recording medium storing license management program
US11288140B2 (en) Point in time blob restore
CN110381150B (en) Data processing method and device on block chain, electronic equipment and storage medium
JP2018147448A (en) Information processing device, program update control method of management control device, and program update control program
CN107209882B (en) Multi-stage de-registration for managed devices
CN111858234A (en) Task execution method, device, equipment and medium
CN110716972A (en) Method and device for processing error of high-frequency calling external interface
CN110659042A (en) Server firmware management method and device
US11954081B1 (en) Management of two application versions in one database table
US9244723B2 (en) Medium, method, and apparatus

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