CN110673943A - Method and device for realizing timing task, electronic equipment and storage medium - Google Patents
Method and device for realizing timing task, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110673943A CN110673943A CN201910936974.3A CN201910936974A CN110673943A CN 110673943 A CN110673943 A CN 110673943A CN 201910936974 A CN201910936974 A CN 201910936974A CN 110673943 A CN110673943 A CN 110673943A
- Authority
- CN
- China
- Prior art keywords
- task
- timing
- timing task
- library
- unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012544 monitoring process Methods 0.000 claims abstract description 44
- 230000001360 synchronised effect Effects 0.000 claims abstract description 37
- 230000007717 exclusion Effects 0.000 claims description 17
- 230000005012 migration Effects 0.000 claims description 5
- 238000013508 migration Methods 0.000 claims description 5
- 230000004048 modification Effects 0.000 description 9
- 238000012986 modification Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3017—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is implementing multitasking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention discloses a method and a device for realizing a timing task, electronic equipment and a storage medium, relates to the technical field of computers, and can effectively improve the efficiency of modifying operation of the timing task. The method comprises the following steps: synchronizing a timing task to be monitored once from a task library every preset time interval to form a timing task list, wherein the timing task in the task library is editable by a user and does not belong to a system file; and carrying out timing monitoring on the timing task according to the timing task recorded in the latest synchronous timing task list and the corresponding execution time. The invention is suitable for monitoring the timing task.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for implementing a timing task, an electronic device, and a storage medium.
Background
cron is a timed execution tool under linux that can run jobs without human intervention. After the cron is started, all the configuration files of the cron are read, and then the scheduled work tasks are called according to the commands and the execution time in the configuration files.
When a new timing task or an existing timing task needs to be modified, the corresponding cron system file needs to be modified. Due to the importance and complexity of the system files, the operation of the system files often has higher operation authority and requirements, so that the modification of the timing task is slow to take effect, and the operation of the timing modification is inefficient.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for implementing a timing task, an electronic device, and a storage medium, which can effectively improve the efficiency of modifying a timing task.
In a first aspect, an embodiment of the present invention provides a method for implementing a timing task, including: synchronizing a timing task to be monitored once from a task library every preset time interval to form a timing task list, wherein the timing task in the task library is editable by a user and does not belong to a system file; and carrying out timing monitoring on the timing task according to the timing task recorded in the latest synchronous timing task list and the corresponding execution time.
Optionally, synchronizing the timing task to be monitored from the task library once every preset time interval includes: and each program operation unit in the at least two program operation units synchronizes timing tasks which need to be monitored respectively once from the task library at intervals of preset time length, wherein the timing tasks monitored by each program operation unit are not repeated.
Optionally, the performing timing monitoring on the timing task according to the timing task recorded in the latest synchronized timing task list and the corresponding execution time includes: each program running unit in the at least two program running units competes for the mutual exclusion lock; and the program operating units competing the mutual exclusion lock perform timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronous timing task list.
Optionally, the method further includes: when the first program operation unit has a fault during operation, feeding back the fault condition to the task library; and migrating the timing tasks which are executed and/or not executed in the first program running unit to other program running units by carrying out synchronous operation on the task library at intervals of preset time length.
Optionally, the method further includes: when the first program running unit needs to be closed, feeding a closing instruction back to the task library; and migrating the timing task which is not executed in the first program running unit to other program running units by carrying out synchronous operation on the task library at intervals of preset time length.
Optionally, the method further includes: receiving an editing operation on the task library, wherein the editing operation comprises at least one of the following: adding a timing task, deleting the timing task and modifying the timing task; the step of synchronizing the timing tasks to be monitored from the task library once every preset time interval to form a timing task list comprises the following steps: and synchronizing the edited timing task to the timing task list once from the task library by presetting time length at each interval.
In a second aspect, an embodiment of the present invention further provides an apparatus for implementing a timing task, including: the device comprises a synchronization unit, a task library and a monitoring unit, wherein the synchronization unit is used for synchronizing a timing task to be monitored once from the task library at intervals of preset time length to form a timing task list, the timing task in the task library is editable by a user, and the task library does not belong to a system file; and the monitoring unit is used for carrying out timing monitoring on the timing task according to the timing task recorded in the latest synchronous timing task list and the corresponding execution time.
Optionally, the synchronization unit is specifically configured to synchronize, once from the task library, each timing task that needs to be monitored at a preset time interval in each of the at least two program running units, where the timing tasks monitored by each of the program running units are not repeated.
Optionally, the monitoring unit includes: the competition module is used for each program running unit in at least two program running units to compete for the mutual exclusion lock; and the monitoring module is used for competing program operation units of the mutual exclusion lock and carrying out timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronous timing task list.
Optionally, the apparatus further comprises: the first feedback unit is used for feeding back the fault condition to the task library when the first program operation unit has a fault during operation; and the first migration unit is used for migrating the timing tasks which are executed and/or are not executed in the first program operation unit to other program operation units by performing synchronous operation on the task library at intervals of preset time length.
Optionally, the apparatus further comprises: the second feedback unit feeds back a closing instruction to the task library when the first program operation unit needs to be closed; and the second migration unit is used for migrating the timing task which is not executed in the first program operation unit to other program operation units by carrying out synchronous operation on the task library at intervals of preset time length.
Optionally, the apparatus further includes a receiving unit, configured to receive an editing operation on the task library, where the editing operation includes at least one of: adding a timing task, deleting the timing task and modifying the timing task; and the synchronization unit is also used for synchronizing the timing task needing monitoring once from the task library by presetting time length at intervals and synchronizing the edited timing task to the timing task list.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, and is used for executing any timing task implementation method provided by the embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement any one of the methods for implementing timing tasks provided by the embodiments of the present invention.
The implementation method, the implementation device, the electronic device and the storage medium of the timing task provided by the embodiment of the invention can synchronize the timing task to be monitored once from the task library at each interval of preset duration to form a timing task list, and perform timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronized timing task list. The timed tasks in the task library are editable by the user, and the task library does not belong to a system file, so that the user can conveniently edit the timed tasks in the task library, and the edited timed tasks are timely updated to the timed task list through synchronous operation of preset time duration at intervals, so that the modification of the timed tasks is timely effective, and the modification operation efficiency of the timed tasks is effectively improved.
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, 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 the drawings without creative efforts.
Fig. 1 is a flowchart of a method for implementing a timing task according to an embodiment of the present invention;
FIG. 2 is a task execution flow diagram of distributed timed task monitoring in an embodiment of the present invention;
FIG. 3 is a block diagram of a process architecture for distributed timed task monitoring in accordance with an embodiment of the present invention;
FIG. 4 is a detailed flowchart of a method for implementing a timing task according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an apparatus for implementing a timing task according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all 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.
In a first aspect, embodiments of the present invention provide a method for implementing a timing task, which can effectively improve the efficiency of modifying the timing task.
As shown in fig. 1, a method for implementing a timing task according to an embodiment of the present invention includes:
s11, synchronizing a timing task to be monitored once from a task library at intervals of preset time length to form a timing task list, wherein the timing task in the task library is editable by a user and does not belong to a system file;
optionally, the task library in the embodiment of the present invention may be any file and/or database that can record a timed task and is established by a user, for example, a text file, a relational database MySQL, and the like. The task library is established by a user, does not belong to the system file, and is not necessarily restricted by the management of the system file.
Optionally, one or more timing tasks may be recorded in the task library, and each timing task may have its own identifier and a corresponding time node.
In this step, the synchronization operation is performed once every preset time interval, optionally, the preset time intervals of the synchronization operations may be equal or different, for example, in an embodiment of the present invention, the preset time interval may be 1 minute, in another embodiment of the present invention, the preset time interval may also be 1 minute for the first time interval, and 3 minutes for the second time interval.
And S12, performing timing monitoring on the timing task according to the timing task recorded in the latest synchronous timing task list and the corresponding execution time.
In this step, the timed task list can periodically synchronize the latest version data in the task library and be read by the timing system in time, so as to perform timing monitoring on the timed task according to the timed task and the corresponding execution time recorded in the timed task list. Optionally, in an embodiment of the present invention, if the data amount in the task library is huge and the execution times of many tasks are far apart, each time data synchronization is performed, only timing tasks before a preset time node may be synchronized, for example, only timing tasks within one hour are synchronized.
The implementation method of the timing task provided by the embodiment of the invention can synchronize the timing task to be monitored once from the task library at intervals of preset duration to form a timing task list, and perform timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronized timing task list. The timed tasks in the task library are editable by the user, and the task library does not belong to a system file, so that the user can conveniently edit the timed tasks in the task library, and the edited timed tasks are timely updated to the timed task list through synchronous operation of preset time duration at intervals, so that the modification of the timed tasks is timely effective, and the modification operation efficiency of the timed tasks is effectively improved.
Optionally, when the timing tasks are numerous, in order to further improve the operation efficiency of the monitoring program and improve the disaster tolerance performance of the monitoring program, in an embodiment of the present invention, in step S11, synchronizing the timing tasks to be monitored from the task library at a time every preset time interval may specifically include:
and each program operation unit in the at least two program operation units synchronizes timing tasks which need to be monitored respectively once from the task library at intervals of preset time length, wherein the timing tasks monitored by each program operation unit are not repeated.
Optionally, in this embodiment, the program running unit may include a relatively independent program structure such as a docker (container) or a process. Each program operation unit can simultaneously or sequentially synchronize data from the task library. The task library can record which program running unit takes over and monitors each timing task. The preset time intervals for performing data synchronization by each program operation unit may be equal or different, and this is not limited in the embodiment of the present invention. Different program operation units can be operated on the same server or different servers to form a distributed system.
For example, at time T1, five timing tasks of task1, task2, task3, task4 and task5 exist in the task library in one embodiment of the invention. The program operation unit P1 synchronizes tasks task1, task2 and task3 in the task library to the timing program list L1 in the program operation unit P1, and the program operation unit P2 synchronizes tasks task4 and task5 in the task library to the timing program list L2 in the program operation unit P2. At time T2, the user has modified the task library, adding timed tasks task6, task 7. At time T3, the program running unit P1 synchronizes tasks task1, task2, task3, and task6 in the task library to the timer program list L1 in the program running unit P1. At time T4, the program operation unit P2 synchronizes tasks task4, task5, and task7 in the task library to the timer program list L2 in the program operation unit P2.
Further, in order to orderly perform the timing tasks among the program operation units when the timing tasks are monitored by at least two program operation units, in an embodiment of the present invention, the step S12 may specifically include, according to the timing tasks and the corresponding execution times recorded in the latest synchronized timing task list, performing timing monitoring on the timing tasks:
each program running unit in the at least two program running units competes for the mutual exclusion lock;
and the program operating units competing the mutual exclusion lock perform timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronous timing task list.
Specifically, the task execution flow of the distributed timed task monitoring may be as shown in fig. 2, and the program architecture of the distributed timed task monitoring may be as shown in fig. 3. With reference to fig. 2 and fig. 3, since each timing task may involve read/write operations of the memory and/or the database, in order to avoid conflicts between the read/write operations of different program operating units (e.g., docker) on the memory and/or the database, in an embodiment of the present invention, a mutual exclusion lock may be applied to the timing task before the timing tasks monitored by the different program operating units are executed, and each program operating unit may allow the timing task to be executed only when competing for the mutual exclusion lock. Otherwise, if a program running unit does not compete for the mutex this time, the timing task cannot be executed this time. The program running unit can continue to compete for the mutex lock at the next time until the mutex lock is competed, and then the timed task is executed.
In the embodiment, different timing tasks in the task library are respectively monitored by the plurality of program operation units, and the program operation units cooperate with each other, so that the monitoring efficiency is greatly improved. Moreover, in other embodiments of the present invention, when some program running units have running faults due to various reasons or when the execution task is arranged additionally, the monitoring timing task can be transferred to other program running units for continuous monitoring, thereby effectively improving the disaster tolerance performance of task monitoring.
Optionally, in an embodiment of the present invention, the method for implementing the timing task provided by the embodiment of the present invention may further include:
when the first program operation unit has a fault during operation, feeding back the fault condition to the task library;
and migrating the timing tasks which are executed and/or not executed in the first program running unit to other program running units by carrying out synchronous operation on the task library at intervals of preset time length.
Optionally, in another embodiment of the present invention, the method for implementing the timing task provided in the embodiment of the present invention may further include:
when the first program running unit needs to be closed, feeding a closing instruction back to the task library;
and migrating the timing task which is not executed in the first program running unit to other program running units by carrying out synchronous operation on the task library at intervals of preset time length.
The above embodiments illustrate how effective monitoring of timed tasks can be achieved. It can be understood that, while monitoring the timing task is realized, the implementation method of the timing task provided by the embodiment of the invention also allows a user to edit and modify the timing task at any time, and can enable the editing and modifying to take effect in time, thereby effectively improving the modification operation efficiency of the timing task.
For example, optionally, in an embodiment of the present invention, the method for implementing the timing task provided in the embodiment of the present invention may further include:
receiving an editing operation on the task library, wherein the editing operation comprises at least one of the following: adding a timing task, deleting the timing task and modifying the timing task;
the step of synchronizing the timing tasks to be monitored from the task library once every preset time interval to form a timing task list comprises the following steps:
and synchronizing the edited timing task to the timing task list once from the task library by presetting time length at each interval.
The following describes in detail a method for implementing a timing task according to an embodiment of the present invention with a specific embodiment.
As shown in fig. 4, a method for implementing a timing task according to an embodiment of the present invention may include:
s201, synchronizing a timing task to be monitored once from a task library database every 1 minute by a program running unit B1 to form a timing task list 1; every 2 minutes, a program running unit B2 synchronizes a timing task to be monitored once from the task database data to form a timing task list 2;
four tasks of task11, task12, task13 and task14 exist in the task library;
wherein tasks 11, 13 are synchronized into list1, and tasks 12, 14 are synchronized into list 2.
S202, receiving editing operation of a user on database of the task library, adding task15 and deleting task 13;
s203, the program running unit B1 synchronizes timing tasks needing to be monitored from the task library database, and updates the timing task list1 to task11 and task 15;
s204, a program running unit B2 synchronizes timing tasks needing monitoring from a task library database, and a timing task list2 is that task12 and task14 are unchanged;
the time of S205 and t1, the timing time specified by tasks task11 and task12 arrive at the same time, and the program operation unit B1 and the program operation unit B2 compete for the mutual exclusion lock;
s206, the program running unit B1 contends the mutual exclusion lock, and the program running unit B2 does not contend the mutual exclusion lock;
s207, the program running unit B1 continues to run, and the task11 executes, for example, the read-write operation of the preset database D1 is executed; the program running unit B2 waits;
s208, the program running unit B2 continuously competes for the mutex lock, the program running unit B2 runs, and the task12 executes, for example, the read-write operation on the preset database D1 is executed;
s209, in the execution process of the task12, when a program operation unit B2 breaks down and cannot normally operate, sending the fault condition to a task library database;
s210, recording task12 and task14 by the database, wherein the task 8932 is not monitored by B2;
s211, a program running unit B1 synchronizes timing tasks needing to be monitored from a task library database, and a timing task list1 is updated to be task12, task14 and task 15.
In a second aspect, an embodiment of the present invention further provides a device for implementing a timing task, which can effectively improve the efficiency of modifying the timing task.
As shown in fig. 5, an apparatus for implementing a timing task according to an embodiment of the present invention may include:
the synchronization unit 31 is configured to synchronize a timing task to be monitored once from a task library at each interval of a preset duration to form a timing task list, where the timing task in the task library is editable by a user, and the task library does not belong to a system file;
and the monitoring unit 32 is configured to perform timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronized timing task list.
The device for realizing the timing task provided by the embodiment of the invention can synchronize the timing task to be monitored once from the task library at intervals of preset duration to form a timing task list, and perform timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronized timing task list. The timed tasks in the task library are editable by the user, and the task library does not belong to a system file, so that the user can conveniently edit the timed tasks in the task library, and the edited timed tasks are timely updated to the timed task list through synchronous operation of preset time duration at intervals, so that the modification of the timed tasks is timely effective, and the modification operation efficiency of the timed tasks is effectively improved.
Optionally, the task library includes a relational database and/or a text file.
Optionally, the synchronizing unit 31 is specifically configured to synchronize, once from the task library, each timing task that needs to be monitored at a preset time interval in each of the at least two program running units, where the timing tasks monitored by each of the program running units are not repeated.
Optionally, the monitoring unit 32 may include:
the competition module is used for each program running unit in at least two program running units to compete for the mutual exclusion lock;
and the monitoring module is used for competing program operation units of the mutual exclusion lock and carrying out timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronous timing task list.
Optionally, the apparatus may further include:
the first feedback unit is used for feeding back the fault condition to the task library when the first program operation unit has a fault during operation;
and the first migration unit is used for migrating the timing tasks which are executed and/or are not executed in the first program operation unit to other program operation units by performing synchronous operation on the task library at intervals of preset time length.
Optionally, the apparatus may further include:
the second feedback unit feeds back a closing instruction to the task library when the first program operation unit needs to be closed;
and the second migration unit is used for migrating the timing task which is not executed in the first program operation unit to other program operation units by carrying out synchronous operation on the task library at intervals of preset time length.
Optionally, the apparatus may further include a receiving unit, configured to receive an editing operation on the task library, where the editing operation includes at least one of: adding a timing task, deleting the timing task and modifying the timing task;
the synchronizing unit 31 is further configured to synchronize a timing task to be monitored from the task library once at preset time intervals, and synchronize the edited timing task to the timing task list.
In a third aspect, an embodiment of the present invention further provides an electronic device, which can effectively improve the efficiency of modifying a timing task.
As shown in fig. 6, an electronic device provided in an embodiment of the present invention may include: the device comprises a shell 51, a processor 52, a memory 53, a circuit board 54 and a power circuit 55, wherein the circuit board 54 is arranged inside a space enclosed by the shell 51, and the processor 52 and the memory 53 are arranged on the circuit board 54; a power supply circuit 55 for supplying power to each circuit or device of the electronic apparatus; the memory 53 is used to store executable program code; the processor 52 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 53, so as to execute the implementation method of the timing task provided by any one of the foregoing embodiments.
For specific execution processes of the above steps by the processor 52 and further steps executed by the processor 52 by running the executable program code, reference may be made to the description of the foregoing embodiments, and details are not described herein again.
The above electronic devices exist in a variety of forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. This type of device comprises: audio, video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(5) And other electronic equipment with data interaction function.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs can be executed by one or more processors to implement any implementation method of the timing task provided in the foregoing embodiment, so that corresponding technical effects can also be achieved, which has been described in detail above and will not be described herein again.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
For convenience of description, the above devices are described separately in terms of functional division into various units/modules. Of course, the functionality of the units/modules may be implemented in one or more software and/or hardware implementations of the invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for implementing a timing task, comprising:
synchronizing a timing task to be monitored once from a task library every preset time interval to form a timing task list, wherein the timing task in the task library is editable by a user and does not belong to a system file;
and carrying out timing monitoring on the timing task according to the timing task recorded in the latest synchronous timing task list and the corresponding execution time.
2. The method of claim 1, wherein synchronizing the timed task to be monitored from the task library once every predetermined time interval comprises:
and each program operation unit in the at least two program operation units synchronizes timing tasks which need to be monitored respectively once from the task library at intervals of preset time length, wherein the timing tasks monitored by each program operation unit are not repeated.
3. The method according to claim 2, wherein the performing timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the timing task list synchronized latest comprises:
each program running unit in the at least two program running units competes for the mutual exclusion lock;
and the program operating units competing the mutual exclusion lock perform timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronous timing task list.
4. The method of claim 2, further comprising:
when the first program operation unit has a fault during operation, feeding back the fault condition to the task library;
and migrating the timing tasks which are executed and/or not executed in the first program running unit to other program running units by carrying out synchronous operation on the task library at intervals of preset time length.
5. The method of claim 2, further comprising:
when the first program running unit needs to be closed, feeding a closing instruction back to the task library;
and migrating the timing task which is not executed in the first program running unit to other program running units by carrying out synchronous operation on the task library at intervals of preset time length.
6. The method of any one of claims 1 to 5, further comprising:
receiving an editing operation on the task library, wherein the editing operation comprises at least one of the following: adding a timing task, deleting the timing task and modifying the timing task;
the step of synchronizing the timing tasks to be monitored from the task library once every preset time interval to form a timing task list comprises the following steps:
and synchronizing the edited timing task to the timing task list once from the task library by presetting time length at each interval.
7. An apparatus for implementing a timing task, comprising:
the device comprises a synchronization unit, a task library and a monitoring unit, wherein the synchronization unit is used for synchronizing a timing task to be monitored once from the task library at intervals of preset time length to form a timing task list, the timing task in the task library is editable by a user, and the task library does not belong to a system file;
and the monitoring unit is used for carrying out timing monitoring on the timing task according to the timing task recorded in the latest synchronous timing task list and the corresponding execution time.
8. The apparatus according to claim 7, wherein the synchronization unit is specifically configured to synchronize, once from the task library, each timing task that needs to be monitored at every interval of a preset duration for each of the at least two program running units, where the timing tasks monitored by the program running units are not repeated.
9. The apparatus of claim 8, wherein the monitoring unit comprises:
the competition module is used for each program running unit in at least two program running units to compete for the mutual exclusion lock;
and the monitoring module is used for competing program operation units of the mutual exclusion lock and carrying out timing monitoring on the timing task according to the timing task and the corresponding execution time recorded in the latest synchronous timing task list.
10. The apparatus of claim 8, further comprising:
the first feedback unit is used for feeding back the fault condition to the task library when the first program operation unit has a fault during operation;
and the first migration unit is used for migrating the timing tasks which are executed and/or are not executed in the first program operation unit to other program operation units by performing synchronous operation on the task library at intervals of preset time length.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910936974.3A CN110673943A (en) | 2019-09-29 | 2019-09-29 | Method and device for realizing timing task, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910936974.3A CN110673943A (en) | 2019-09-29 | 2019-09-29 | Method and device for realizing timing task, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110673943A true CN110673943A (en) | 2020-01-10 |
Family
ID=69080319
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910936974.3A Pending CN110673943A (en) | 2019-09-29 | 2019-09-29 | Method and device for realizing timing task, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110673943A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112463348A (en) * | 2021-01-27 | 2021-03-09 | 北京搜狐新媒体信息技术有限公司 | Timed task processing method and device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859260A (en) * | 2010-05-14 | 2010-10-13 | 中国科学院计算技术研究所 | Timer management device and management method for operating system |
US9152474B2 (en) * | 2014-01-20 | 2015-10-06 | Netapp, Inc. | Context aware synchronization using context and input parameter objects associated with a mutual exclusion lock |
CN108255596A (en) * | 2016-12-28 | 2018-07-06 | 福建省天奕网络科技有限公司 | A kind of method and system for performing timed task |
CN108989390A (en) * | 2018-06-19 | 2018-12-11 | 北京智明星通科技股份有限公司 | User requests retransmission method and device, Reverse Proxy and computer readable storage medium |
CN109298924A (en) * | 2018-09-26 | 2019-02-01 | 中国平安人寿保险股份有限公司 | Management method, computer readable storage medium and the terminal device of timed task |
CN109298962A (en) * | 2018-09-03 | 2019-02-01 | 中国平安人寿保险股份有限公司 | Monitoring method, computer readable storage medium and the terminal device of timed task |
CN110019059A (en) * | 2017-12-04 | 2019-07-16 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of Timing Synchronization |
CN110162569A (en) * | 2019-04-15 | 2019-08-23 | 平安普惠企业管理有限公司 | Data processing method, device and computer equipment based on GG synchronized process |
CN110221905A (en) * | 2019-05-22 | 2019-09-10 | 网联清算有限公司 | Timed task monitoring method, device, system, equipment and storage medium |
-
2019
- 2019-09-29 CN CN201910936974.3A patent/CN110673943A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859260A (en) * | 2010-05-14 | 2010-10-13 | 中国科学院计算技术研究所 | Timer management device and management method for operating system |
US9152474B2 (en) * | 2014-01-20 | 2015-10-06 | Netapp, Inc. | Context aware synchronization using context and input parameter objects associated with a mutual exclusion lock |
CN108255596A (en) * | 2016-12-28 | 2018-07-06 | 福建省天奕网络科技有限公司 | A kind of method and system for performing timed task |
CN110019059A (en) * | 2017-12-04 | 2019-07-16 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of Timing Synchronization |
CN108989390A (en) * | 2018-06-19 | 2018-12-11 | 北京智明星通科技股份有限公司 | User requests retransmission method and device, Reverse Proxy and computer readable storage medium |
CN109298962A (en) * | 2018-09-03 | 2019-02-01 | 中国平安人寿保险股份有限公司 | Monitoring method, computer readable storage medium and the terminal device of timed task |
CN109298924A (en) * | 2018-09-26 | 2019-02-01 | 中国平安人寿保险股份有限公司 | Management method, computer readable storage medium and the terminal device of timed task |
CN110162569A (en) * | 2019-04-15 | 2019-08-23 | 平安普惠企业管理有限公司 | Data processing method, device and computer equipment based on GG synchronized process |
CN110221905A (en) * | 2019-05-22 | 2019-09-10 | 网联清算有限公司 | Timed task monitoring method, device, system, equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112463348A (en) * | 2021-01-27 | 2021-03-09 | 北京搜狐新媒体信息技术有限公司 | Timed task processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105045602B (en) | Method and device for constructing Hadoop application development framework and electronic device | |
CN106899648A (en) | A kind of data processing method and equipment | |
CN104714957B (en) | A kind of variation and device of table structure | |
CN111782295A (en) | Application program running method and device, electronic equipment and storage medium | |
WO2015085901A1 (en) | File transmission method and device, and related system | |
CN111259066A (en) | Server cluster data synchronization method and device | |
CN111143039A (en) | Virtual machine scheduling method and device and computer storage medium | |
CN108536470A (en) | A kind of development approach and system of resource file | |
CN105512276B (en) | Method and device for constructing junk file and electronic equipment | |
CN110673943A (en) | Method and device for realizing timing task, electronic equipment and storage medium | |
CN110652728A (en) | Game resource management method and device, electronic equipment and storage medium | |
CN110609967B (en) | List generation method and device and storage medium | |
CN115309347B (en) | Time management method, device, equipment and medium based on SSD master control frequency conversion | |
CN111143463A (en) | Method and device for constructing bank data warehouse based on topic model | |
CN111176924A (en) | GPU card dropping simulation method, system, terminal and storage medium | |
CN115858101A (en) | Method and device for isolating container resource view and electronic equipment | |
CN110162569A (en) | Data processing method, device and computer equipment based on GG synchronized process | |
CN111880896B (en) | Method and device for rapidly restoring container and running state data | |
CN114281321A (en) | Software development fast editing method and device, electronic equipment and medium | |
CN109947561B (en) | Virtual scene processing method and device and storage medium | |
CN114153480A (en) | Code synchronization method, component publishing method, device thereof and computer storage medium | |
CN109542598B (en) | Timed task management method and device | |
CN109510682B (en) | Method, device, terminal and storage medium for synchronizing BMC (baseboard management controller) clocks of pooling server system | |
CN111857865A (en) | Event type task processing method and device, electronic equipment and storage medium | |
CN112036149A (en) | File editing method and device, electronic 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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210602 Address after: 25, 5th floor, shuangjingfang office building, 3 frisha street, 189352, Singapore Applicant after: Zhuomi Private Ltd. Address before: Room 1101, Santai Commercial Building, 139 Connaught Road, Hong Kong, China Applicant before: HONG KONG LIVE.ME Corp.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200110 |