CN112486645A - Timed task monitoring method and device, electronic equipment and medium - Google Patents

Timed task monitoring method and device, electronic equipment and medium Download PDF

Info

Publication number
CN112486645A
CN112486645A CN202011360115.3A CN202011360115A CN112486645A CN 112486645 A CN112486645 A CN 112486645A CN 202011360115 A CN202011360115 A CN 202011360115A CN 112486645 A CN112486645 A CN 112486645A
Authority
CN
China
Prior art keywords
task
execution time
executed
task execution
fragmentation
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.)
Withdrawn
Application number
CN202011360115.3A
Other languages
Chinese (zh)
Inventor
周鹏华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN202011360115.3A priority Critical patent/CN112486645A/en
Publication of CN112486645A publication Critical patent/CN112486645A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

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

Abstract

The embodiment of the invention discloses a method and a device for monitoring a timed task, electronic equipment and a medium. The timing task monitoring method comprises the following steps: determining target task execution time according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task; acquiring the number of the executed fragment task from a message queue according to the target task execution time; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time; and monitoring the execution condition of the timing task according to the number of the executed fragmentation task and the number of the preset fragmentation tasks. The embodiment of the invention provides a timed task monitoring method suitable for a project executing a timed task, wherein a party executing the timed task can timely detect the condition of execution failure of the timed task, so that the reliability and the stability of a system are improved.

Description

Timed task monitoring method and device, electronic equipment and medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a method and a device for monitoring a timed task, electronic equipment and a medium.
Background
When the timing task is executed by the timing task execution server, the timing task execution server may be affected by network failure, system downtime, source data analysis failure, and the like, so that the timing task cannot be executed accurately on time. In order to timely find out the condition that the timing task is not normally executed, the timing task needs to be monitored.
In the prior art, the monitoring of the timing task is carried out by the project triggering the timing task, and the monitoring requirement of the project executing the timing task on the timing task cannot be met.
Disclosure of Invention
The embodiment of the invention provides a method and a device for monitoring a timing task, electronic equipment and a medium, which aim to monitor the timing task through a project for executing the timing task.
In a first aspect, an embodiment of the present invention provides a method for monitoring a timed task, including:
determining target task execution time according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task;
acquiring the number of the executed fragment task from a message queue according to the target task execution time; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time;
and monitoring the execution condition of the timing task according to the number of the executed fragmentation task and the number of the preset fragmentation tasks.
In a second aspect, an embodiment of the present invention further provides a device for monitoring a timed task, including:
the target task execution time determining module is used for determining the target task execution time according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task;
the number acquisition module of the executed fragmentation task is used for acquiring the number of the executed fragmentation task from the message queue according to the execution time of the target task; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time;
and the timing task execution condition monitoring module is used for monitoring the timing task execution condition according to the number of the executed fragmentation tasks and the preset fragmentation task quantity.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of timed task monitoring as described in any embodiment of the present invention.
In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute a timed task monitoring method according to any one of the embodiments.
The embodiment of the invention provides a timed task monitoring method suitable for a project executing a timed task, wherein a party executing the timed task can acquire the number of an executed fragmented task according to the execution time of the timed task, and then monitor the execution condition of the timed task according to the number of the executed fragmented task and the preset number of fragmented tasks. The technical scheme provided by the embodiment of the invention can detect the condition of the execution failure of the timing task in time, thereby improving the reliability and stability of the system.
Drawings
Fig. 1 is a flowchart of a timed task monitoring method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a timed task monitoring method in the second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a timed task monitoring device in a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device to which the timed task monitoring method in the embodiment of the present invention is applied.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a timed task monitoring method in an embodiment of the present invention, which is applicable to a situation where a project executing a timed task monitors an execution situation of the timed task. The method can be executed by a timed task monitoring device, which can be implemented in software and/or hardware and can be configured in an electronic device, such as a server or other electronic devices with communication and computing capabilities. As shown in fig. 1, the method specifically includes:
s110, determining the execution time of a target task according to the timing task execution rule and the current task execution time; wherein the execution rule is used for prescribing the execution time of the timing task.
The timing task refers to a task executed based on a given time point, a given time interval or a given execution number. Illustratively, the timed tasks are tasks performed on Mondays through Friday at 10:15 a.m. each day.
And the timed task execution rules specify the execution time of the timed task. The timed task execution rules are associated with the timed task. For example, for a task to be performed on Monday through Friday at 10:15 am each day, the timed task execution rule is that the task needs to be performed on Monday through Friday at 10:15 am each day. Optionally, the timing task execution rule is a cron expression. Wherein, the cron expression is a character string composed of special characters and numbers according to a specific grammar, the character string is separated by 5 or 6 spaces and divided into 6 or 7 fields, each field represents a meaning, for example, the 10:15 am execution of monday through friday can be represented by the cron expression (01510?mon-FRI).
The current task execution time refers to the current time when the project executing the timing task starts to execute the timing task, and is opposite to the last time or the next time when the project executing the timing task executes the same timing task.
The target task execution time is earlier than the current task execution time, and the project executing the timing task executes other task execution times of the same timing task. It is noted that the current task execution time and the target task execution time are both concepts of time points.
Because the current task execution time represents the current moment of executing the timed task by the project executing the timed task, and the timed task execution rule comprises the execution time rule of the timed task, the target task execution time can be determined according to the timed task execution rule and the current task execution time. For example, when the timed task is a task executed once every 1 minute, the timed task execution rule is that the task needs to be executed once every 1 minute. If the current time is 12:00, the project executing the timing task starts to execute the timing task. Then the current task execution time may be determined to be 12:00, according to the current timing task execution rule and the current task execution time, determining that the time for executing the same timing task in the project executing the timing task adjacent to the current execution time last time is 11: 59.
s120, acquiring the number of the executed fragment task from a message queue according to the target task execution time; the message queue is used for storing the slicing task numbers executed by the task execution server in the target task execution time.
Wherein, the message queue is a container for storing messages in the transmission process of the messages. In the embodiment of the invention, the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time.
The number of the executed fragmentation task refers to the number of the fragmentation task executed by the task execution server in the execution time of the target task in the execution project of the task. Wherein, the fragmentation task is a subtask obtained by the fragmentation of the timing task. It should be noted that, when determining the fragmented task number executed by the task execution server at the target task execution time, the target task execution time is a time period, which is a time period between the target task execution time and a next task execution time adjacent to the target task execution time. The number of executed fragmentation tasks is the fragmentation task number of the task execution server executed obtained in the time period.
And determining the execution time of the target task, namely acquiring the number of the executed fragment task from the message queue according to the execution time of the target task.
In an alternative embodiment, the target task execution time is a last task execution time that is adjacent to the current task execution time.
When the project for executing the task executes the timing task, each task execution server may have a time delay when executing the fragmentation task of the timing task. In other words, there may be situations where the execution server may execute a sharded task later than the current task execution time. It should be noted that the time delay referred to herein is the time delay existing in the normal operation state of the system, and the time delay is far less than the time interval of the execution of the timed task specified by the timed task execution rule. The target task execution time is determined as the last task execution time adjacent to the current task execution time, so that the condition of misjudgment of the timing task condition caused by system time delay can be effectively avoided, and the condition of abnormal timing task execution can be timely found.
And S130, monitoring the execution condition of the timed task according to the number of the executed slicing tasks and the number of the preset slicing tasks.
The preset fragmentation task refers to the number of the timed tasks fragmented into subtasks, and the preset fragmentation number is an empirical value set by a person skilled in the art according to an actual service scene, and is not limited herein and is specifically determined according to an actual situation. The preset fragmentation task number refers to the number of subtasks required to be completed to complete a timing task. The number of executed fragmentation tasks indicates the fragmentation task that has been executed. Optionally, the number of the preset fragments is compared with the number of the executed fragment task, so that the execution condition of the timing task can be monitored.
In an optional embodiment, the monitoring the execution condition of the timed task according to the number of the executed fragmentation tasks and the number of preset fragmentation tasks includes: if the number of the executed fragmentation tasks is inconsistent with the preset fragmentation task number, determining that the timing task is not normally executed, and generating alarm information that the timing task is not normally executed; and if the number of the executed slicing tasks is consistent with the preset slicing task number, determining that the timing task is normally executed, and generating a prompt message for normally executing all the timing task slices.
If the number of the executed fragmentation tasks is inconsistent with the preset fragmentation task number, the fragmentation tasks of the timing tasks which are not executed exist, the timing tasks can be further determined to be not normally executed, and at the moment, the alarm information of the timing tasks which are not normally executed is generated.
If the number of the executed fragmentation tasks is consistent with the preset fragmentation task number, the fragmentation tasks of the timing task are all executed, the timing task can be determined to be normally executed, and prompt information of all the normally executed timing task fragments is generated at the moment.
By counting the number of the executed fragmentation tasks and comparing the number of the executed fragmentation tasks with the preset fragmentation number, the execution condition of the timing task can be monitored, the timing task monitoring process is simplified, and the working efficiency of the system is improved.
According to the technical scheme provided by the embodiment of the invention, the target task execution time is determined according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task; acquiring the number of the executed fragment task from a message queue according to the target task execution time; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time; and monitoring the execution condition of the timing task according to the number of the executed fragmentation task and the number of the preset fragmentation tasks. The embodiment of the invention provides a timed task monitoring method suitable for a project executing a timed task, wherein a party executing the timed task can acquire the number of an executed fragmented task according to the execution time of the timed task, and then monitor the execution condition of the timed task according to the number of the executed fragmented task and the preset number of fragmented tasks. The technical scheme provided by the embodiment of the invention can detect the condition of the execution failure of the timing task in time, thereby improving the reliability and stability of the system.
Example two
Fig. 2 is a flowchart of a timed task monitoring method in the second embodiment of the present invention, and the present embodiment further optimizes, specifically optimizes, on the basis of the foregoing embodiment: the process of storing the fragmentation task number executed by the task execution server in the target task execution time to the message queue comprises the following steps: acquiring the serial number of the slicing task executed by the task execution server in the current task execution time; and storing the current task execution time and the serial number of the slicing task to a message queue.
As shown in fig. 2, the method includes:
s210, acquiring the serial number of the slicing task executed by the task execution server in the current task execution time.
The task execution server is a server for executing the timed task slicing task. The current task execution time refers to a period of time between the current task execution time and the next task execution time adjacent to the current task execution time.
And acquiring the number of the fragment task executed by the task execution server in the current task execution time. The task execution server may be started to report the slicing task execution condition at the current task execution time, so that the task execution server reports the executed slicing task number according to the execution condition of the slicing task itself.
S220, storing the current task execution time and the serial number of the slicing task to a message queue.
The current task execution time refers to the execution time of the engineering execution timing task for executing the timing task, and the current task execution time is a moment and can be a moment for starting the reporting of the execution condition of the task slicing task of the task execution server.
The number of the fragmentation task refers to the number of the fragmentation task executed by the task execution server within a period of time between the current task execution time and the next task execution time adjacent to the current task execution time. That is, the number of the slice tasks executed in the period from the current task execution time to the next task execution time.
And storing the current task execution time and the serial number of the fragment task to a message queue so as to monitor the execution condition of the timing task according to the current task execution time and the serial number of the fragment task.
In an optional embodiment, the storing the current task execution time and the number of the sliced task to a message queue includes: storing a key value pair formed by the current task execution time and the serial number of the slicing task to the message queue; wherein, the key information is the current task execution time, and the value information is the serial number of the slicing task.
The key information corresponding to the slicing task numbers acquired in the same time period is consistent, that is, as long as the slicing task is executed in a period of time between the current task execution time and the next task execution time adjacent to the current task execution time, the number is value information, and the key information corresponding to the value information is the current task execution time. The key value pair consisting of the current execution time of the timing task and the serial number of the fragment task executed in the current task execution time is stored in the message queue, so that the serial number of the executed fragment task can be acquired from the message queue only under the condition that the execution time of the timing task is determined, and the execution condition of the timing task is acquired. The acquisition process of the timing task execution condition is simplified, and the system efficiency is improved.
Since a timing task often involves the execution of a large amount of data business logic, a plurality of task execution servers are often required to process simultaneously to complete the task. Therefore, one timing task is divided into a plurality of fragments to obtain a plurality of fragment tasks, and each fragment is issued to different task execution servers to be executed, so that the efficiency of executing the timing task is improved.
In an optional embodiment, before the obtaining the number of the fragmentation task executed by the task execution server at the current task execution time, the method further includes: dividing the timing task into a preset number of fragments to obtain a preset number of fragment tasks; and sending the fragmentation tasks and the timing task execution rules to a preset number of task execution servers so that each task execution server can report the serial number of each fragmentation task after executing each fragmentation task.
The preset number is an empirical value set by a person skilled in the art according to factors such as an actual service scenario and the number of available task execution servers, and is not limited herein and is specifically determined according to an actual situation.
The method includes the steps of fragmenting the timing task into a preset number of fragmentation tasks, and then sending the fragmentation tasks and the timing task execution rules to a preset number of task execution servers, wherein the fragmentation tasks can be respectively issued to different task execution servers. The timed task execution rules specify the execution time of the timed tasks, and the fragmented tasks and the timed task execution rules are sent to the task execution servers with the preset number, so that the task execution servers can execute the fragmented tasks according to the timed task execution rules. And each task execution server responds to the instruction reported by the execution condition of the slicing task and reports the number of each executed slicing task.
Optionally, after the timing task is divided into the preset number of division tasks, the division tasks are numbered in advance. And establishing association between the fragment task number and the task execution server, comparing the obtained number of the executed fragment task reported by the task execution server with the preset number one by one to determine the task execution server which does not normally work, and achieving the effect of accurately positioning the abnormity.
The embodiment of the invention can realize the asynchronous data processing by acquiring the serial number of the fragment task executed by the task execution server in the current task execution time and storing the current task execution time and the serial number of the fragment task in the message queue, namely acquiring the message from the message queue when the data needs to be processed, thereby improving the response speed of the system. And the current task execution time and the serial number of the fragment task executed by the current task execution time are stored in a message queue for standby, so that the execution condition of the timing task is conveniently monitored.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a timed task monitoring device in a third embodiment of the present invention, which is applicable to a case where a project executing a timed task monitors an execution condition of the timed task. The apparatus may be implemented by software and/or hardware, and may be configured in an electronic device.
As shown in fig. 3, the apparatus may include: a target task execution time determining module 310, a number acquiring module 320 of executed fragment tasks, and a timed task execution condition monitoring module 330.
A target task execution time determining module 310, configured to determine a target task execution time according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task;
a number obtaining module 320 for the executed fragmentation task, configured to obtain, from the message queue, a number of the executed fragmentation task according to the target task execution time; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time;
and the timed task execution condition monitoring module 330 is configured to monitor the timed task execution condition according to the number of the executed fragmentation tasks and the preset fragmentation task number. According to the technical scheme provided by the embodiment of the invention, the target task execution time is determined according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task; acquiring the number of the executed fragment task from a message queue according to the target task execution time; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time; and monitoring the execution condition of the timing task according to the number of the executed fragmentation task and the number of the preset fragmentation tasks. The embodiment of the invention provides a timed task monitoring method suitable for a project executing a timed task, wherein a party executing the timed task can acquire the number of an executed fragmented task according to the execution time of the timed task, and then monitor the execution condition of the timed task according to the number of the executed fragmented task and the preset number of fragmented tasks. The technical scheme provided by the embodiment of the invention can detect the condition of the execution failure of the timing task in time, thereby improving the reliability and stability of the system.
Optionally, the apparatus further comprises: the data storage module is specifically used for storing the slicing task number executed by the task execution server in the target task execution time to the message queue; wherein the data storage module comprises: a fragmentation task number obtaining submodule, configured to obtain a number of a fragmentation task executed by the task execution server at the current task execution time; and the data storage submodule is used for storing the current task execution time and the serial number of the slicing task to a message queue.
Optionally, the data storage sub-module is specifically configured to store, to the message queue, a key-value pair formed by the current task execution time and the serial number of the sliced task; wherein, the key information is the current task execution time, and the value information is the serial number of the slicing task.
Optionally, the timed task execution monitoring module 330 includes: the warning information generation submodule is used for determining that the timing task is not normally executed if the number of the serial numbers of the executed fragmentation tasks is inconsistent with the number of the preset fragmentation tasks, and generating warning information that the timing task is not normally executed; and the prompt information generation sub-module is used for determining that the timing task is normally executed if the number of the serial numbers of the executed fragmentation tasks is consistent with the preset fragmentation task number, and generating the prompt information for normally executing all the timing task fragments.
Optionally, the device further includes a timed task fragmenting module, configured to divide the timed task into a preset number of fragments to obtain a preset number of fragment tasks before the number of the fragment task executed by the task execution server in the current task execution time is obtained; and the fragmentation task distribution module is used for sending the fragmentation tasks and the timing task execution rules to a preset number of task execution servers so that each task execution server can report the serial number of each fragmentation task after executing each fragmentation task.
Optionally, the target task execution time is a last task execution time adjacent to the current task execution time.
The timed task monitoring device provided by the embodiment of the invention can execute the timed task monitoring method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the timed task monitoring method.
Example four
The invention also provides an electronic device and a readable storage medium according to the embodiment of the invention.
Fig. 4 is a schematic structural diagram of an electronic device implementing the timed task monitoring method according to the embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable electronic devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of embodiments of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic apparatus includes: one or more processors 410, memory 420, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output device (such as a display electronic device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each electronic device providing portions of the necessary operations (e.g., as an array of electronic devices, a set of blade-like electronic devices, or a multi-processor system). One processor 410 is illustrated in fig. 4.
The memory 420 is a non-transitory computer readable storage medium provided by the embodiments of the present invention. The memory stores instructions executable by the at least one processor, so that the at least one processor executes the method for monitoring the timed task provided by the embodiment of the invention. The non-transitory computer-readable storage medium of the embodiment of the present invention stores computer instructions for causing a computer to execute the timed task monitoring method provided by the embodiment of the present invention.
The memory 420 serves as a non-transitory computer readable storage medium, and may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the timed task monitoring method in the embodiment of the present invention (for example, the program instructions/modules shown in fig. 3 include the target task execution time determination module 310, the number acquisition module 320 for executed fragmentation tasks, and the timed task execution condition monitoring module 330). The processor 410 executes various functional applications and data processing of the electronic device by executing non-transitory software programs, instructions and modules stored in the memory 420, namely, implements the timed task monitoring method in the above method embodiment.
The memory 420 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the electronic device implementing the timed task monitoring method, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 420 may optionally include memory located remotely from processor 410, which may be connected over a network to an electronic device performing the timed task monitoring method. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device performing the timed task monitoring method may further include: an input device 430 and an output device 440. The processor 410, the memory 420, the input device 430, and the output device 440 may be connected by a bus or other means, such as the bus connection in fig. 4.
The input device 430 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus performing the timed task monitoring method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. Output devices 440 may include display electronics, auxiliary lighting devices (e.g., LEDs), tactile feedback devices (e.g., vibrating motors), and the like. The display electronics may include, but are not limited to, Liquid Crystal Displays (LCDs), Light Emitting Diode (LED) displays, and plasma displays. In some implementations, the display electronics can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, electronic device, and/or apparatus (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the embodiments of the present invention may be executed in parallel, may be executed sequentially, or may be executed in different orders, so long as the desired results of the technical solutions disclosed in the embodiments of the present invention can be achieved, which is not limited herein.
The above detailed description does not limit the scope of the embodiments of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the embodiments of the present invention should be included in the scope of the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for monitoring a timed task is characterized by comprising the following steps:
determining target task execution time according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task;
acquiring the number of the executed fragment task from a message queue according to the target task execution time; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time;
and monitoring the execution condition of the timing task according to the number of the executed fragmentation task and the number of the preset fragmentation tasks.
2. The method according to claim 1, wherein the step of storing the fragmented task number executed by the task execution server at the target task execution time in the message queue comprises:
acquiring the serial number of the slicing task executed by the task execution server in the current task execution time;
and storing the current task execution time and the serial number of the slicing task to a message queue.
3. The method of claim 2, wherein storing the current task execution time and the number of the sliced task to a message queue comprises:
storing a key value pair formed by the current task execution time and the serial number of the slicing task to the message queue;
wherein, the key information is the current task execution time, and the value information is the serial number of the slicing task.
4. The method according to claim 1, wherein the monitoring the execution of the timed task according to the number of the executed fragmentation task and the number of the preset fragmentation tasks comprises:
if the number of the executed fragmentation tasks is inconsistent with the preset fragmentation task number, determining that the timing task is not normally executed, and generating alarm information that the timing task is not normally executed;
and if the number of the executed slicing tasks is consistent with the preset slicing task number, determining that the timing task is normally executed, and generating a prompt message for normally executing all the timing task slices.
5. The method according to claim 2, further comprising, before the obtaining the number of the slicing task executed by the task execution server at the current task execution time, the following:
dividing the timing task into a preset number of fragments to obtain a preset number of fragment tasks;
and sending the fragmentation tasks and the timing task execution rules to a preset number of task execution servers so that each task execution server can report the serial number of each fragmentation task after executing each fragmentation task.
6. The method of claim 1, wherein the target task execution time is a last task execution time that is adjacent to the current task execution time.
7. A timed task monitoring apparatus, comprising:
the target task execution time determining module is used for determining the target task execution time according to the timing task execution rule and the current task execution time; the execution rule is used for stipulating the execution time of the timing task;
the number acquisition module of the executed fragmentation task is used for acquiring the number of the executed fragmentation task from the message queue according to the execution time of the target task; the message queue is used for storing the slicing task number executed by the task execution server in the target task execution time;
and the timing task execution condition monitoring module is used for monitoring the timing task execution condition according to the number of the executed fragmentation tasks and the preset fragmentation task quantity.
8. The apparatus of claim 7, further comprising:
the data storage module is specifically used for storing the slicing task number executed by the task execution server in the target task execution time to the message queue;
wherein the data storage module comprises:
a fragmentation task number obtaining submodule, configured to obtain a number of a fragmentation task executed by the task execution server at the current task execution time;
and the data storage submodule is used for storing the current task execution time and the serial number of the slicing task to a message queue.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the timed task monitoring method of any one of claims 1 to 6.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the timed task monitoring method of any one of claims 1 to 6.
CN202011360115.3A 2020-11-27 2020-11-27 Timed task monitoring method and device, electronic equipment and medium Withdrawn CN112486645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011360115.3A CN112486645A (en) 2020-11-27 2020-11-27 Timed task monitoring method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011360115.3A CN112486645A (en) 2020-11-27 2020-11-27 Timed task monitoring method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN112486645A true CN112486645A (en) 2021-03-12

Family

ID=74936125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011360115.3A Withdrawn CN112486645A (en) 2020-11-27 2020-11-27 Timed task monitoring method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN112486645A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113723892A (en) * 2021-09-13 2021-11-30 北京沃东天骏信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN115080336A (en) * 2021-03-16 2022-09-20 网联清算有限公司 Timed task monitoring method and device, server and readable storage medium
CN115168137A (en) * 2022-06-17 2022-10-11 北京结慧科技有限公司 Monitoring method and system for timing task, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080336A (en) * 2021-03-16 2022-09-20 网联清算有限公司 Timed task monitoring method and device, server and readable storage medium
CN113723892A (en) * 2021-09-13 2021-11-30 北京沃东天骏信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN115168137A (en) * 2022-06-17 2022-10-11 北京结慧科技有限公司 Monitoring method and system for timing task, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112486645A (en) Timed task monitoring method and device, electronic equipment and medium
CN111049705B (en) Method and device for monitoring distributed storage system
US20210092195A1 (en) Information push method and device
US10380867B2 (en) Alert management within a network based virtual collaborative space
CN111506401B (en) Automatic driving simulation task scheduling method and device, electronic equipment and storage medium
CN112000450A (en) Neural network architecture searching method and device
CN111913884A (en) Distributed test method, device, equipment, system and readable storage medium
CN111880914A (en) Resource scheduling method, resource scheduling apparatus, electronic device, and storage medium
CN112491617B (en) Link tracking method, device, electronic equipment and medium
CN111694857A (en) Method and device for storing resource data, electronic equipment and computer readable medium
CN112311597A (en) Message pushing method and device
CN111813623A (en) Page monitoring method and device, electronic equipment and storage medium
CN111049690A (en) Equipment fault monitoring processing method, device, equipment and storage medium
CN110620701B (en) Data stream monitoring processing method, device, equipment and storage medium
CN112395126A (en) Fault log processing method and device, electronic equipment and storage medium
CN112965799A (en) Task state prompting method and device, electronic equipment and medium
CN111782357A (en) Label control method and device, electronic equipment and readable storage medium
CN111694686B (en) Processing method and device for abnormal service, electronic equipment and storage medium
CN111510480B (en) Request sending method and device and first server
EP3832985B1 (en) Method and apparatus for processing local hot spot, electronic device and storage medium
CN112148447B (en) Task processing method and system based on risk control and electronic equipment
US10678590B1 (en) Batch process monitoring and alerting based on selection of buffer times
CN112527527A (en) Consumption speed control method and device of message queue, electronic equipment and medium
CN110659184A (en) Health state checking method, device and system
CN112817686A (en) Method, device and equipment for detecting exception of virtual machine and computer 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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20210312