[go: up one dir, main page]

CN115658445A - Timing task visualization method and device, electronic equipment and storage medium - Google Patents

Timing task visualization method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115658445A
CN115658445A CN202211365834.3A CN202211365834A CN115658445A CN 115658445 A CN115658445 A CN 115658445A CN 202211365834 A CN202211365834 A CN 202211365834A CN 115658445 A CN115658445 A CN 115658445A
Authority
CN
China
Prior art keywords
task
target
timed
state
visualization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211365834.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.)
Shanghai Pinwei Information Technology Co ltd
Original Assignee
Shanghai Pinshun Information 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 Shanghai Pinshun Information Technology Co ltd filed Critical Shanghai Pinshun Information Technology Co ltd
Priority to CN202211365834.3A priority Critical patent/CN115658445A/en
Publication of CN115658445A publication Critical patent/CN115658445A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a timing task visualization method, which is applied to a visualization system and comprises the following steps: receiving a target timing task message sent by a task system and determining a visual record table of a target timing task according to the target timing task message; acquiring process data of the target timing task from a log system according to a visual meta-configuration table and the target timing task information; and displaying the target timing task according to the visual record list and the process data, wherein the visual record list is determined by processing the received timing task message, the process data corresponding to the timing task is obtained, the state display and the execution process description are carried out on a large number of timing tasks according to the visual record list and the process data, and the overtime task is alarmed by analyzing the average execution time of the past tasks.

Description

定时任务可视化方法、装置、电子设备及存储介质Timing task visualization method, device, electronic device and storage medium

技术领域technical field

本发明涉及可视化领域,特别是涉及一种定时任务可视化方法、装置、电子设备及存储介质。The invention relates to the field of visualization, in particular to a timing task visualization method, device, electronic equipment and storage medium.

背景技术Background technique

线上的金融业务中存在大量的跑批任务,并有以下的特点:1、执行时间多在凌晨,难以及时监控;2、任务数量多,且存在互相依赖;3、有些任务需要监控过程数据,才能知道是否正常执行;4、任务执行时间和完成进度紧迫,如果发生延期,需要及时通知开发人员处理;5、定时任务分布在多个不同业务子系统当中。常规的解决方案是,在每个定时任务的逻辑当中,插入执行日志和执行状态的数据库记录。使用常规方案,缺点包括以下几点:1、业务侵入性强,需要开发人员进行业务无关的重复编码,降低了系统的安全性;2、显示不及时,没有主动提醒的功能;3、维护成本高,随之项目越来越多,将会难以管理众多分散的监控逻辑;4、查看不直观,依赖开发人员主动查看日志和数据库的记录。There are a large number of running batch tasks in the online financial business, and have the following characteristics: 1. The execution time is mostly in the early morning, and it is difficult to monitor in time; 2. There are many tasks and they are interdependent; 3. Some tasks need to monitor process data , to know whether it is normally executed; 4. The task execution time and completion progress are urgent. If there is a delay, the developer needs to be notified in time to deal with it; 5. Timing tasks are distributed among multiple different business subsystems. The conventional solution is to insert execution logs and database records of execution status into the logic of each scheduled task. The disadvantages of using the conventional solution include the following points: 1. The business is highly intrusive, requiring developers to perform repetitive coding irrelevant to the business, which reduces the security of the system; 2. The display is not timely and there is no active reminder function; 3. Maintenance costs High, with more and more projects, it will be difficult to manage many scattered monitoring logic; 4. The view is not intuitive, relying on developers to actively view logs and database records.

发明内容Contents of the invention

基于此,有必要针对上述技术问题,提供一种能够自动显示和监控大量定时任务执行状态和过程数据的定时任务可视化方法、装置、电子设备及存储介质。Based on this, it is necessary to provide a timing task visualization method, device, electronic device and storage medium capable of automatically displaying and monitoring a large amount of timing task execution status and process data for the above technical problems.

第一方面,提供一种定时任务可视化方法,应用于可视化系统,所述方法包括:In the first aspect, a timing task visualization method is provided, which is applied to a visualization system, and the method includes:

接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;receiving the target timing task message sent by the task system and determining the visual recording table of the target timing task according to the target timing task information;

根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;Acquiring the process data of the target timing task from the log system according to the visualization meta-configuration table and the target timing task information;

根据所述可视化记录表和所述过程数据显示所述目标定时任务。The target timed task is displayed according to the visualized record table and the process data.

在其中一个实施例中,所述接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:In one of the embodiments, the receiving the scheduled task message sent by the task system and determining the visual recording table of the target scheduled task according to the scheduled task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

在其中一个实施例中,所述根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:In one of the embodiments, the obtaining the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

在其中一个实施例中,所述根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:In one of the embodiments, the obtaining the first process data from the log system according to the visualization meta-configuration table and the timed task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

在其中一个实施例中,一种定时任务可视化方法,应用于任务系统,所述方法包括:In one of the embodiments, a timing task visualization method is applied to a task system, and the method includes:

当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;When the start execution time of the target scheduled task is reached, determine whether there is a predecessor task of the target scheduled task;

若否,则开始执行所述目标定时任务以供日志系统记录过程数据;If not, start to execute the target timing task for the log system to record the process data;

确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;determining that the target timed task state is the first timed task state in execution and regularly sending a target timed task message including the first timed task state to the visualization system according to the task execution time threshold;

若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。If yes, determine whether the predecessor task is completed and send the target scheduled task message to the visualization system.

在其中一个实施例中,所述确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:In one of the embodiments, the determining whether the predecessor task is completed and sending the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

在其中一个实施例中,所述发送所述目标定时任务消息到所述可视化系统之后包括:In one of the embodiments, after sending the target scheduled task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

另一方面,提供一种定时任务可视化装置,应用于可视化系统,所述装置包括:On the other hand, a timing task visualization device is provided, which is applied to a visualization system, and the device includes:

记录确定模块,用于接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;The record determination module is used to receive the target timing task message sent by the task system and determine the visual recording table of the target timing task according to the target timing task information;

获取模块,用于根据可视化元配置表和所述目标定时任务信息获取所述目标定时任务的过程数据;An acquisition module, configured to acquire the process data of the target timing task according to the visualization meta-configuration table and the target timing task information;

显示模块,用于根据所述可视化记录表和所述过程数据显示所述目标定时任务。A display module, configured to display the target timed task according to the visualized record table and the process data.

在其中一个实施例中,所述记录确定模块接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:In one of the embodiments, the record determination module receives the scheduled task message sent by the task system and determines the visual record table of the target scheduled task according to the scheduled task information, including:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

在其中一个实施例中,所述获取模块根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:In one of the embodiments, the acquisition module acquires the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

在其中一个实施例中,所述获取模块根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:In one of the embodiments, the acquiring module acquires the first process data from the log system according to the visualization meta-configuration table and the timed task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

在其中一个实施例中,提供一种定时任务可视化装置,应用于任务系统,所述装置包括:In one of the embodiments, a timing task visualization device is provided, which is applied to a task system, and the device includes:

任务确定模块,用于当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;A task determination module, configured to determine whether there is a predecessor task of the target timing task when the start execution time of the target timing task is reached;

执行模块,用于若否,则开始执行所述目标定时任务以供日志系统记录过程数据;Execute module, be used for if not, then begin to execute described target timed task so that log system records process data;

发送模块,用于确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;A sending module, configured to determine that the target timed task state is the first timed task state in execution and regularly send a target timed task message including the first timed task state to the visualization system according to the task execution time threshold;

所述发送模块,还用于若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。The sending module is further configured to, if yes, determine whether the predecessor task is completed and send the target timed task message to the visualization system.

在其中一个实施例中,所述发送模块确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:In one of the embodiments, the sending module determines whether the predecessor task is completed and sends the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

在其中一个实施例中,所述发送模块发送所述目标定时任务消息到所述可视化系统之后包括:In one of the embodiments, after the sending module sends the target timing task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

再一方面,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In yet another aspect, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the following steps are implemented:

接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;receiving the target timing task message sent by the task system and determining the visual recording table of the target timing task according to the target timing task information;

根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;Acquiring the process data of the target timing task from the log system according to the visualization meta-configuration table and the target timing task information;

根据所述可视化记录表和所述过程数据显示所述目标定时任务。The target timed task is displayed according to the visualized record table and the process data.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:The visual recording table of receiving the scheduled task message sent by the task system and determining the target scheduled task according to the scheduled task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:The acquiring the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:The obtaining the first process data from the log system according to the visualization meta-configuration table and the scheduled task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

一种定时任务可视化方法,应用于任务系统,所述方法包括:A timing task visualization method applied to a task system, the method comprising:

当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;When the start execution time of the target scheduled task is reached, determine whether there is a predecessor task of the target scheduled task;

若否,则开始执行所述目标定时任务以供日志系统记录过程数据;If not, start to execute the target timing task for the log system to record the process data;

确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;determining that the target timed task state is the first timed task state in execution and regularly sending a target timed task message including the first timed task state to the visualization system according to the task execution time threshold;

若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。If yes, determine whether the predecessor task is completed and send the target scheduled task message to the visualization system.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:The determining whether the predecessor task is completed and sending the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述发送所述目标定时任务消息到所述可视化系统之后包括:After sending the target timed task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

又一方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In yet another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;receiving the target timing task message sent by the task system and determining the visual recording table of the target timing task according to the target timing task information;

根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;Acquiring the process data of the target timing task from the log system according to the visualization meta-configuration table and the target timing task information;

根据所述可视化记录表和所述过程数据显示所述目标定时任务。The target timed task is displayed according to the visualized record table and the process data.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:The visual recording table of receiving the scheduled task message sent by the task system and determining the target scheduled task according to the scheduled task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:The acquiring the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:The obtaining the first process data from the log system according to the visualization meta-configuration table and the scheduled task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

一种定时任务可视化方法,应用于任务系统,所述方法包括:A timing task visualization method applied to a task system, the method comprising:

当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;When the start execution time of the target scheduled task is reached, determine whether there is a predecessor task of the target scheduled task;

若否,则开始执行所述目标定时任务以供日志系统记录过程数据;If not, start to execute the target timing task for the log system to record the process data;

确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;determining that the target timed task state is the first timed task state in execution and regularly sending a target timed task message including the first timed task state to the visualization system according to the task execution time threshold;

若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。If yes, determine whether the predecessor task is completed and send the target scheduled task message to the visualization system.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:The determining whether the predecessor task is completed and sending the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述发送所述目标定时任务消息到所述可视化系统之后包括:After sending the target timed task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;根据所述可视化记录表和所述过程数据显示所述目标定时任务,其中通过处理接收到的定时任务消息确定可视化记录表并获取定时任务对应的过程数据,根据可视化记录表和过程数据显示多个定时任务状态和其他具体数据。Receive the target timing task message sent by the task system and determine the visual recording table of the target timing task according to the target timing task information; obtain the process data of the target timing task from the log system according to the visualization meta configuration table and the target timing task information ; Displaying the target timing task according to the visualization record table and the process data, wherein the visualization record table is determined by processing the received timing task message and the process data corresponding to the timing task is obtained, and multiple displays are displayed according to the visualization record table and process data Timed task status and other specific data.

附图说明Description of drawings

图1为应用于可视化系统的定时任务可视化方法的流程示意图;FIG. 1 is a schematic flow diagram of a timing task visualization method applied to a visualization system;

图2为应用于可视化系统的定时任务可视化方法的步骤示意图;Fig. 2 is a schematic diagram of the steps of the timing task visualization method applied to the visualization system;

图3为应用于任务系统的定时任务可视化方法的流程示意图;Fig. 3 is a schematic flow chart of a timing task visualization method applied to a task system;

图4为定时任务的示例灰度图;Figure 4 is an example grayscale image of a scheduled task;

图5为应用于可视化系统的定时任务可视化装置的结构示意图;Fig. 5 is a schematic structural diagram of a timing task visualization device applied to a visualization system;

图6为本发明实施例中计算机设备的内部结构图。FIG. 6 is an internal structure diagram of a computer device in an embodiment of the present invention.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

本申请提供的定时任务可视化方法,可以应用于如图1所示的应用于可视化系统的定时任务可视化方法的流程示意图中。其中,通过接收到的定时任务消息中的定时任务状态确定可视化记录表并获取定时任务对应的过程数据,根据可视化记录表和过程数据显示多个定时任务状态和其他具体数据。The timing task visualization method provided in the present application can be applied to the schematic flowchart of the timing task visualization method applied to a visualization system as shown in FIG. 1 . Wherein, the visual record table is determined through the timed task state in the received timed task message, and the process data corresponding to the timed task is obtained, and multiple timed task states and other specific data are displayed according to the visualized record table and process data.

在一个实施例中,如图2所示,本发明提供一种定时任务可视化方法,应用于可视化系统,所述方法包括:In one embodiment, as shown in FIG. 2, the present invention provides a timing task visualization method, which is applied to a visualization system, and the method includes:

S201、接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;S201. Receive a target scheduled task message sent by the task system and determine a visual record table of the target scheduled task according to the target scheduled task information;

S202、根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;S202. Obtain the process data of the target scheduled task from the log system according to the visualization meta-configuration table and the target scheduled task information;

S203、根据所述可视化记录表和所述过程数据显示所述目标定时任务。S203. Display the target scheduled task according to the visualized record table and the process data.

具体的,通过处理接收到的定时任务消息确定可视化记录表并获取定时任务对应的过程数据,根据可视化记录表和过程数据显示多个定时任务状态和其他具体数据。Specifically, the visualized record table is determined by processing the received timed task message and the process data corresponding to the timed task is acquired, and multiple timed task states and other specific data are displayed according to the visualized record table and process data.

在其中一个实施例中,所述接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:In one of the embodiments, the receiving the scheduled task message sent by the task system and determining the visual recording table of the target scheduled task according to the scheduled task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

具体的,当接收到包含第一定时任务状态(执行中)的定时任务消息后,确定是否第一次接收到该定时任务,若是,说明没有该定时任务对应的可视化记录表,需要根据定时任务信息生成可视化记录表,其中定时任务信息除了包含定时任务状态还包含任务编码、任务名称、任务产出、任务开始时间、任务结束时间、任务创建时间等,根据上述任务相关信息生成对应的可视化记录表。当接收到包含第二定时任务状态的定时任务消息时,确定是否存在当前定时任务的可视化记录表,若不存在,同理根据定时任务消息生成可视化记录表。如果接收到包含第三定时任务状态或者第四定时任务状态的定时任务消息,因为已经接收到包含第一定时任务状态的定时任务消息即已经生成当前定时任务的可视化记录表,所以无需重复操作。Specifically, after receiving the scheduled task message containing the status of the first scheduled task (executing), determine whether the scheduled task is received for the first time. If so, it means that there is no visual record table corresponding to the scheduled task. The information generates a visual record table, in which the scheduled task information includes not only the status of the scheduled task, but also the task code, task name, task output, task start time, task end time, task creation time, etc., and the corresponding visual record is generated according to the above task-related information surface. When receiving the scheduled task message including the status of the second scheduled task, it is determined whether there is a visualized record table of the current scheduled task, and if not, a visualized record table is generated based on the scheduled task message similarly. If a scheduled task message containing the third scheduled task status or the fourth scheduled task status is received, since the scheduled task message containing the first scheduled task status has already been received, the visual record table of the current scheduled task has been generated, so there is no need to repeat the operation.

在其中一个实施例中,所述根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:In one of the embodiments, the obtaining the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

具体的,当接收到包含第二定时任务状态的定时任务消息时,由于前置任务仍在执行且此时定时任务等待执行,此时的第二过程数据一定包含定时任务检查失败的字样,如果还包含执行前置任务时产生的第二过程数据,则无需根据可视化元配置表查询日志系统。其中,根据可视化元配置表和上述定时任务信息中包含的前置任务的任务编码、任务名称、任务产出、任务开始时间、任务结束时间、任务创建时间等查询日志系统中记录的第二过程数据(包括执行前置任务的任务次数、时间和相关任务数据)。当接受到包含第三定时任务状态或第四定时任务状态的定时任务消息时,从当前执行队列中删除该定时任务并且此时的过程数据就是定时任务名称+执行成功/执行失败,比如取现借据形态转移任务执行成功这条数据就是执行该定时任务产生的最后一条过程数据,无需查询日志系统。另外,当定时任务消息中包含告警信息时同样无需查询日志系统,根据“前置任务(取现业务罚息减免任务)出错”这条告警信息和可视化记录表显示前置任务出错。Specifically, when a scheduled task message containing the status of the second scheduled task is received, since the predecessor task is still executing and the scheduled task is waiting to be executed at this time, the second process data at this time must contain the words that the scheduled task check failed, if It also includes the second process data generated during the execution of the pre-task, so there is no need to query the log system based on the visualization meta-configuration table. Among them, query the second process recorded in the log system according to the task code, task name, task output, task start time, task end time, task creation time, etc. Data (including the number of tasks, time and related task data for performing predecessor tasks). When receiving a scheduled task message containing the third scheduled task status or the fourth scheduled task status, delete the scheduled task from the current execution queue and the process data at this time is the scheduled task name + execution success/execution failure, such as cash withdrawal receipt The data of the successful execution of the shape transfer task is the last piece of process data generated by executing the scheduled task, and there is no need to query the log system. In addition, when the scheduled task message contains alarm information, there is no need to query the log system. According to the alarm message "predecessor task (cash withdrawal business penalty interest reduction task) error" and the visual record table, the predecessor task error is displayed.

在其中一个实施例中,所述根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:In one of the embodiments, the obtaining the first process data from the log system according to the visualization meta-configuration table and the timed task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

具体的,当接受到包含第一定时任务状态的定时任务消息且定时任务消息中没有相关的过程数据时,假设任务开始时间为13:00:00,从当前执行队列得知当前执行任务时间为13:30:00,然后根据定时任务消息中包含的具体任务名称(取现业务罚息减免任务)和任务编码(20)等以及可视化元配置表中的模板“CREATE TABLE`vipshop_credit_job_task_record`(Specifically, when a scheduled task message containing the status of the first scheduled task is received and there is no relevant process data in the scheduled task message, assuming that the task start time is 13:00:00, it is known from the current execution queue that the current execution time of the task is 13:30:00, then according to the specific task name (cash withdrawal business penalty interest reduction task) and task code (20) contained in the scheduled task message and the template "CREATE TABLE`vipshop_credit_job_task_record`(

`id`bigint(20)unsignedNOT NULL AUTO_INCREMENT COMMENT'id',`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',

`job_code`varchar(100)NOT NULL DEFAULT”COMMENT'任务编码',`job_code` varchar(100) NOT NULL DEFAULT "COMMENT'job code',

`job_name`varchar(100)NOT NULL DEFAULT”COMMENT'任务名称',`job_name` varchar(100) NOT NULL DEFAULT "COMMENT'job name',

)ENGINE=InnoDB AUTO_INCREMENT=26693DEFAULT CHARSET=utf8)ENGINE=InnoDB AUTO_INCREMENT=26693 DEFAULT CHARSET=utf8

COMMENT='元数据配置'”查询日志系统中13:00:00-13:30:00时间段内记载的第一过程数据(包括执行定时任务的任务次数、具体时间和相关任务数据等)。COMMENT='metadata configuration'" to query the first process data recorded in the log system during the period of 13:00:00-13:30:00 (including the number of tasks to perform scheduled tasks, specific time and related task data, etc.).

在其中一个实施例中,一种定时任务可视化方法,应用于任务系统,所述方法包括:In one of the embodiments, a timing task visualization method is applied to a task system, and the method includes:

当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;When the start execution time of the target scheduled task is reached, determine whether there is a predecessor task of the target scheduled task;

若否,则开始执行所述目标定时任务以供日志系统记录过程数据;If not, start to execute the target timing task for the log system to record the process data;

确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;determining that the target timed task state is the first timed task state in execution and regularly sending a target timed task message including the first timed task state to the visualization system according to the task execution time threshold;

若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。If yes, determine whether the predecessor task is completed and send the target scheduled task message to the visualization system.

具体的,如图3所示,当定时任务到达定时任务开始时间后,首先确定当前的定时任务是否存在前置任务,其中如图4所示,下一个任务(定时任务)是依赖上一个任务(前置任务)完成才可能成功执行的,例如定时任务(取现借据形态转移任务)到达定时任务触发时间,因为没有前置任务,所以直接开始执行当前的定时任务并定期发送包含第一定时任务状态(执行中)的目标定时任务信息到可视化系统,在执行定时任务时日志系统会将定时任务存储到工作集合中并记录执行过程中产生的过程数据;再例如当取现分期并期任务到达定时任务触发时间时,确定它有前置任务(取现借据形态转移任务),此时需要确定前置任务是否完成。Specifically, as shown in Figure 3, when the scheduled task reaches the start time of the scheduled task, first determine whether the current scheduled task has a predecessor task, where as shown in Figure 4, the next task (timed task) is dependent on the previous task (predecessor task) can be successfully executed only after completion, for example, a scheduled task (cash withdrawal IOU form transfer task) reaches the trigger time of the scheduled task, because there is no predecessor task, so the current scheduled task will be executed directly and the first scheduled task will be sent periodically The target timing task information of the state (in progress) is sent to the visualization system. When the timing task is executed, the log system will store the timing task in the work set and record the process data generated during the execution process; When the task is triggered, it is determined that it has a predecessor task (cash withdrawal IOU form transfer task). At this time, it is necessary to determine whether the predecessor task is completed.

在其中一个实施例中,所述确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:In one of the embodiments, the determining whether the predecessor task is completed and sending the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

具体的,如上所述,当前置任务(取现借据形态转移任务)已完成时,正常执行定时任务(取现分期并期任务);当前置任务仍在执行时,发送包含第二定时任务状态(检查失败)的定时任务消息到可视化系统,等待任务执行时间阈值(比如用户设置的一分钟)之后,继续检测前置任务是否完成并发送对应的定时任务消息到可视化系统,当前置任务在平均任务完成时限(比如一小时)内未完成,不执行取现分期并期任务并发送包含告警信息的定时任务消息到可视化系统,提醒用户检查异常问题。Concretely, as mentioned above, when the preceding task (the transfer task of cash withdrawal form) is completed, the scheduled task (cash withdrawal and staged task) is normally executed; failure) to the visualization system, after waiting for the task execution time threshold (such as one minute set by the user), continue to detect whether the predecessor task is completed and send the corresponding timing task message to the visualization system, the current predecessor task is completed in the average task If it is not completed within the time limit (such as one hour), the cash withdrawal installment task will not be executed and a scheduled task message containing alarm information will be sent to the visualization system to remind users to check for abnormal problems.

在其中一个实施例中,所述发送所述目标定时任务消息到所述可视化系统之后包括:In one of the embodiments, after sending the target scheduled task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

具体的,如上所述,任务系统执行定时任务(取现分期并期任务)成功后,此时执行定时任务结束并确定执行结果无异常,则发送包含第三定时任务状态(成功)的定时任务消息到可视化系统并且当到达下一个定时任务(每日渠道账单罚息同步任务)对应的定时任务触发时间后,开始执行每日渠道账单罚息同步任务。其中,若在平均任务完成时限内定时任务执行异常时,继续执行该定时任务并发送包含第一定时任务状态的定时任务消息到可视化系统。如果超过平均任务完成时限该定时任务仍未完成,此时执行定时任务结束并确认执行结果有异常,则发送包含第四定时任务状态(失败)的定时任务消息到可视化系统并停止执行该任务列表中的每日渠道账单罚息同步任务和其他定时任务,当然不影响执行其他任务列表中的定时任务。Specifically, as described above, after the task system successfully executes the scheduled task (cash withdrawal, installment and scheduled task), at this time, the execution of the scheduled task ends and the execution result is determined to be normal, and then sends a scheduled task message containing the status of the third scheduled task (success) Go to the visualization system and when the trigger time of the scheduled task corresponding to the next scheduled task (daily channel bill penalty interest synchronization task) is reached, start to execute the daily channel bill penalty interest synchronization task. Wherein, if the timing task is executed abnormally within the average task completion time limit, continue to execute the timing task and send a timing task message including the status of the first timing task to the visualization system. If the timed task has not been completed beyond the average task completion time limit, and the execution of the timed task ends at this time and it is confirmed that the execution result is abnormal, then send a timed task message containing the fourth timed task status (failure) to the visualization system and stop executing the task list The daily channel bill penalty interest synchronization task and other scheduled tasks in , of course, will not affect the execution of scheduled tasks in other task lists.

本申请的方案有如下有益效果:The scheme of the present application has the following beneficial effects:

1)通过消息事件驱动和异步监控执行进度实现大量定时任务的可视化,减轻用户的工作压力;1) Realize the visualization of a large number of timed tasks through message event-driven and asynchronous monitoring of execution progress, reducing the work pressure of users;

2)支持主动扫描日志和接收消息传参等多种获取定时任务状态的方式并且通过分析过往任务平均执行时间,对超时任务进行告警;2) It supports multiple ways to obtain the status of scheduled tasks, such as actively scanning logs and receiving message parameters, and alarms overtime tasks by analyzing the average execution time of past tasks;

3)支持Web、App多终端查看任务执行进度。3) Support Web and App multi-terminals to view task execution progress.

应该理解的是,虽然图2的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow chart of FIG. 2 are displayed sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in FIG. 2 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these sub-steps or stages The order is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

在一个实施例中,如图5所示,提供一种定时任务可视化装置,应用于可视化系统,所述装置包括:In one embodiment, as shown in FIG. 5, a timing task visualization device is provided, which is applied to a visualization system, and the device includes:

记录确定模块501,用于接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;A record determination module 501, configured to receive a target timed task message sent by the task system and determine a visual record table of the target timed task according to the target timed task information;

获取模块502,用于根据可视化元配置表和所述目标定时任务信息获取所述目标定时任务的过程数据;An acquisition module 502, configured to acquire the process data of the target scheduled task according to the visualization meta-configuration table and the target scheduled task information;

显示模块503,用于根据所述可视化记录表和所述过程数据显示所述目标定时任务。A display module 503, configured to display the target timed task according to the visualized record table and the process data.

在其中一个实施例中,所述记录确定模块接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:In one of the embodiments, the record determination module receives the scheduled task message sent by the task system and determines the visual record table of the target scheduled task according to the scheduled task information, including:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

在其中一个实施例中,所述获取模块根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:In one of the embodiments, the acquisition module acquires the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

在其中一个实施例中,所述获取模块根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:In one of the embodiments, the acquiring module acquires the first process data from the log system according to the visualization meta-configuration table and the timed task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

在其中一个实施例中,提供一种定时任务可视化装置,应用于任务系统,所述装置包括:In one of the embodiments, a timing task visualization device is provided, which is applied to a task system, and the device includes:

任务确定模块504,用于当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;A task determination module 504, configured to determine whether there is a predecessor task of the target timing task when the start execution time of the target timing task is reached;

执行模块505,用于若否,则开始执行所述目标定时任务以供日志系统记录过程数据;Executing module 505, is used for if not, then start to execute described target timed task for log system to record process data;

发送模块506,用于确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;The sending module 506 is configured to determine that the state of the target timed task is the first timed task state in execution and regularly send a target timed task message including the state of the first timed task to the visualization system according to the task execution time threshold ;

所述发送模块506,还用于若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。The sending module 506 is further configured to, if yes, determine whether the predecessor task is completed and send the target timed task message to the visualization system.

在其中一个实施例中,所述发送模块确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:In one of the embodiments, the sending module determines whether the predecessor task is completed and sends the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

在其中一个实施例中,所述发送模块发送所述目标定时任务消息到所述可视化系统之后包括:In one of the embodiments, after the sending module sends the target timing task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

关于定时任务可视化装置的具体限定可以参见上文中对于定时任务可视化方法的限定,在此不再赘述。上述定时任务可视化装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitations of the timed task visualization device, please refer to the above-mentioned definition of the timed task visualization method, which will not be repeated here. Each module in the above-mentioned timed task visualization device can be fully or partially realized by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现告警信息处理方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure may be as shown in FIG. 6 . The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the alarm information processing method can be realized. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad, or mouse.

本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 6 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.

在一个实施例中,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the following steps when executing the computer program:

接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;receiving the target timing task message sent by the task system and determining the visual recording table of the target timing task according to the target timing task information;

根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;Acquiring the process data of the target timing task from the log system according to the visualization meta-configuration table and the target timing task information;

根据所述可视化记录表和所述过程数据显示所述目标定时任务。The target timed task is displayed according to the visualized record table and the process data.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:The visual recording table of receiving the scheduled task message sent by the task system and determining the target scheduled task according to the scheduled task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:The acquiring the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:The obtaining the first process data from the log system according to the visualization meta-configuration table and the scheduled task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

一种定时任务可视化方法,应用于任务系统,所述方法包括:A timing task visualization method applied to a task system, the method comprising:

当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;When the start execution time of the target scheduled task is reached, determine whether there is a predecessor task of the target scheduled task;

若否,则开始执行所述目标定时任务以供日志系统记录过程数据;If not, start to execute the target timing task for the log system to record the process data;

确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;determining that the target timed task state is the first timed task state in execution and regularly sending a target timed task message including the first timed task state to the visualization system according to the task execution time threshold;

若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。If yes, determine whether the predecessor task is completed and send the target scheduled task message to the visualization system.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:The determining whether the predecessor task is completed and sending the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

所述发送所述目标定时任务消息到所述可视化系统之后包括:After sending the target timed task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;receiving the target timing task message sent by the task system and determining the visual recording table of the target timing task according to the target timing task information;

根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;Acquiring the process data of the target timing task from the log system according to the visualization meta-configuration table and the target timing task information;

根据所述可视化记录表和所述过程数据显示所述目标定时任务。The target timed task is displayed according to the visualized record table and the process data.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:The visual recording table of receiving the scheduled task message sent by the task system and determining the target scheduled task according to the scheduled task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time;

若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue;

当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists;

若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:The acquiring the process data of the target timing task according to the visualization meta-configuration table and the timing task information includes:

当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data;

若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data;

若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message;

当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:The obtaining the first process data from the log system according to the visualization meta-configuration table and the scheduled task message includes:

根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message;

根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

一种定时任务可视化方法,应用于任务系统,所述方法包括:A timing task visualization method applied to a task system, the method comprising:

当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;When the start execution time of the target scheduled task is reached, determine whether there is a predecessor task of the target scheduled task;

若否,则开始执行所述目标定时任务以供日志系统记录过程数据;If not, start to execute the target timing task for the log system to record the process data;

确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;determining that the target timed task state is the first timed task state in execution and regularly sending a target timed task message including the first timed task state to the visualization system according to the task execution time threshold;

若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。If yes, determine whether the predecessor task is completed and send the target scheduled task message to the visualization system.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:The determining whether the predecessor task is completed and sending the target timing task message to the visualization system includes:

若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again;

若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system;

当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

所述发送所述目标定时任务消息到所述可视化系统之后包括:After sending the target timed task message to the visualization system, it includes:

执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal;

若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system;

若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

Claims (10)

1.一种定时任务可视化方法,应用于可视化系统,所述方法包括:1. A timing task visualization method, applied to a visualization system, said method comprising: 接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;receiving the target timing task message sent by the task system and determining the visual recording table of the target timing task according to the target timing task information; 根据可视化元配置表和所述目标定时任务信息从日志系统获取所述目标定时任务的过程数据;Acquiring the process data of the target timing task from the log system according to the visualization meta-configuration table and the target timing task information; 根据所述可视化记录表和所述过程数据显示所述目标定时任务。The target timed task is displayed according to the visualized record table and the process data. 2.根据权利要求1所述的方法,其特征在于,所述接收任务系统发送的定时任务消息并根据所述定时任务信息确定目标定时任务的可视化记录表包括:2. The method according to claim 1, wherein the receiving the scheduled task message sent by the task system and determining the visual recording table of the target scheduled task according to the scheduled task information includes: 当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定是否首次接收到所述定时任务信息;When the timing task status in the timing task message is the first timing task status, determine whether the timing task information is received for the first time; 若是,则根据所述定时任务信息生成所述可视化记录表并将所述目标定时任务存储到当前执行队列中;If yes, then generate the visualization record table according to the timing task information and store the target timing task in the current execution queue; 当所述定时任务状态为第二定时任务状态时,确定所述可视化记录表是否存在;When the state of the timed task is the state of the second timed task, determine whether the visualized record table exists; 若否,则根据所述定时任务信息生成所述可视化记录表。If not, the visualization recording table is generated according to the timed task information. 3.根据权利要求2所述的方法,其特征在于,所述根据可视化元配置表和所述定时任务信息获取所述目标定时任务的过程数据包括:3. The method according to claim 2, wherein said obtaining the process data of the target timing task according to the visualization element configuration table and the timing task information comprises: 当所述定时任务消息中的定时任务状态为第一定时任务状态时,确定所述定时任务信息中是否包含第一过程数据;When the timed task state in the timed task message is the first timed task state, determine whether the timed task information includes the first process data; 若否,则根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据;If not, acquiring the first process data from the log system according to the visualization meta-configuration table and the timing task message; 当所述定时任务状态为第二定时任务状态时,确定所述定时任务信息中是否包含第二过程数据;When the state of the timed task is the state of the second timed task, determine whether the information of the timed task contains second process data; 若否,则根据所述可视化元配置表和所述定时任务消息从日志系统获取所述第二过程数据;If not, acquiring the second process data from a log system according to the visualization meta-configuration table and the timing task message; 当所述定时任务状态为第三定时任务状态或第四定时任务状态时,从所述当前执行队列中删除所述目标定时任务并根据所述定时任务信息获取第三过程数据。When the timed task state is the third timed task state or the fourth timed task state, delete the target timed task from the current execution queue and acquire third process data according to the timed task information. 4.根据权利要求3所述的方法,其特征在于,所述根据所述可视化元配置表和所述定时任务消息从所述日志系统获取所述第一过程数据包括:4. The method according to claim 3, wherein said obtaining the first process data from the log system according to the visualization element configuration table and the timing task message comprises: 根据所述可视化元配置表和所述定时任务消息确定所述目标定时任务的元数据配置;determining the metadata configuration of the target scheduled task according to the visualized meta configuration table and the scheduled task message; 根据所述当前执行队列中记载的当前任务执行时间和所述元数据配置从所述日志系统定时获取所述第一过程数据。The first process data is periodically acquired from the log system according to the current task execution time recorded in the current execution queue and the metadata configuration. 5.一种定时任务可视化方法,应用于任务系统,所述方法包括:5. A timing task visualization method applied to a task system, the method comprising: 当到达目标定时任务的开始执行时间时,确定是否存在所述目标定时任务的前置任务;When the start execution time of the target scheduled task is reached, determine whether there is a predecessor task of the target scheduled task; 若否,则开始执行所述目标定时任务以供日志系统记录过程数据;If not, start to execute the target timing task for the log system to record the process data; 确定所述目标定时任务状态为执行中的第一定时任务状态并根据所述任务执行时间阈值定时发送包含所述第一定时任务状态的目标定时任务消息到所述可视化系统;determining that the target timed task state is the first timed task state in execution and regularly sending a target timed task message including the first timed task state to the visualization system according to the task execution time threshold; 若是,则确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统。If yes, determine whether the predecessor task is completed and send the target scheduled task message to the visualization system. 6.根据权利要求5所述的方法,其特征在于,所述确定所述前置任务是否完成并发送所述目标定时任务消息到所述可视化系统包括:6. The method according to claim 5, wherein the determining whether the predecessor task is completed and sending the target timing task message to the visualization system comprises: 若所述前置任务未完成,则等待所述任务执行时间阈值后,再次确定所述前置任务是否完成;If the predecessor task is not completed, after waiting for the task execution time threshold, determine whether the predecessor task is completed again; 若否,则确定所述目标定时任务状态为检查失败的第二定时任务状态并发送包含所述第二定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the state of the target timed task is the state of the second timed task that fails to check and send a target timed task message that includes the state of the second timed task to the visualization system; 当确定所述前置任务是否完成的工作时间超过平均任务完成时限时,发送告警消息到所述可视化系统。An alarm message is sent to the visualization system when it is determined whether the work time for completing the predecessor task exceeds the average task completion time limit. 7.根据权利要求5所述的方法,其特征在于,所述发送所述目标定时任务消息到所述可视化系统之后包括:7. The method according to claim 5, characterized in that, after sending the target timing task message to the visualization system, comprising: 执行所述目标定时任务结束后,确定所述目标定时任务的执行结果是否异常;After executing the target timing task, determine whether the execution result of the target timing task is abnormal; 若否,则确定所述目标定时任务状态为成功的第三定时任务状态并发送包含所述第三定时任务状态的目标定时任务消息到所述可视化系统;If not, then determine that the target timed task state is a successful third timed task state and send a target timed task message including the third timed task state to the visualization system; 若是,则确定所述目标定时任务状态为失败的第四定时任务状态并发送包含所述第四定时任务状态的目标定时任务消息到所述可视化系统。If yes, then determine that the state of the target timed task is a failed fourth state of the timed task, and send a target timed task message including the state of the fourth timed task to the visualization system. 8.一种定时任务可视化装置,应用于可视化系统,所述装置包括:8. A timing task visualization device applied to a visualization system, said device comprising: 记录确定模块,用于接收任务系统发送的目标定时任务消息并根据所述目标定时任务信息确定目标定时任务的可视化记录表;The record determination module is used to receive the target timing task message sent by the task system and determine the visual recording table of the target timing task according to the target timing task information; 获取模块,用于根据可视化元配置表和所述目标定时任务信息获取所述目标定时任务的过程数据;An acquisition module, configured to acquire the process data of the target timing task according to the visualization meta-configuration table and the target timing task information; 显示模块,用于根据所述可视化记录表和所述过程数据显示所述目标定时任务。A display module, configured to display the target timed task according to the visualized record table and the process data. 9.一种电子设备,其特征在于,包括:9. An electronic device, characterized in that it comprises: 一个或多个处理器;以及与所述一个或多个处理器关联的存储器,所述存储器用于存储程序指令,所述程序指令在被所述一个或多个处理器读取执行时,执行如权利要求1~7中任一所述的方法。one or more processors; and memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, execute The method according to any one of claims 1-7. 10.一种计算机存储介质,其特征在于,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1~7中任一所述的方法。10. A computer storage medium, wherein a computer program is stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1-7 is realized.
CN202211365834.3A 2022-10-31 2022-10-31 Timing task visualization method and device, electronic equipment and storage medium Pending CN115658445A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211365834.3A CN115658445A (en) 2022-10-31 2022-10-31 Timing task visualization method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211365834.3A CN115658445A (en) 2022-10-31 2022-10-31 Timing task visualization method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115658445A true CN115658445A (en) 2023-01-31

Family

ID=84995696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211365834.3A Pending CN115658445A (en) 2022-10-31 2022-10-31 Timing task visualization method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115658445A (en)

Similar Documents

Publication Publication Date Title
US8161323B2 (en) Health monitor
US7788540B2 (en) Tracking down elusive intermittent failures
WO2019148727A1 (en) Electronic device, redis-based exception warning method and storage medium
CN112035235A (en) Task scheduling method, system, device and storage medium
CN110781214A (en) Database reading and writing method and device, computer equipment and storage medium
WO2020242640A1 (en) Automated recovery of webpage functionality
RU2501069C2 (en) Asynchronous multi-level undo support in javascript grid
CN111552596A (en) Compact binary event log generation method and system
US9710353B2 (en) Creating composite baselines based on a plurality of different baselines
CN111796954A (en) Watchdog control method, device, equipment and storage medium based on JVM
JP5545761B2 (en) Failure analysis support system, failure analysis support method, and failure analysis support program
CN115982049A (en) Abnormal detection method, device and computer equipment in performance testing
CN115495197A (en) Configuration information modification method and device, storage medium and electronic equipment
CN113760491B (en) A task scheduling system, method, device and storage medium
CN115658445A (en) Timing task visualization method and device, electronic equipment and storage medium
CN112256544A (en) Early warning method and device for software problems
CN117455643A (en) An intelligent monitoring method, device and equipment for batch processing operations
US10558528B2 (en) Reconstruction of system definitional and state information
WO2019223171A1 (en) Workflow management method and system, computer device and storage medium
CN113971074A (en) Transaction processing method, apparatus, electronic device, and computer-readable storage medium
US8250195B2 (en) Leveraging synchronous communication protocols to enable asynchronous application and line-of-business behaviors
US20030009486A1 (en) Data reducing method, system and program
CN113326147A (en) Large-scale distributed operation state control method and device, terminal and storage medium
CN119226362B (en) Data processing method, apparatus, device, medium, and program product
CN115756797B (en) Queuing system scheduling detection method and device

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: 20250721

Address after: 201106 Shanghai City Minhang District Shenchang Road 1588 Lane 6 Building 902 Room

Applicant after: Shanghai Pinwei Information Technology Co.,Ltd.

Country or region after: China

Address before: Room 903, no.6, Lane 1588, Shenchang Road, Minhang District, Shanghai 201100

Applicant before: SHANGHAI PINSHUN INFORMATION TECHNOLOGY CO.,LTD.

Country or region before: China