Task scheduling and monitoring methods and electronic equipment

By generating scheduling sequences and monitoring threads, the problem of tasks not being triggered on time or being triggered multiple times in the scheduling system is solved. It provides a unified monitoring entry point and fine-grained task monitoring, ensuring the stability of business systems and development efficiency.

CN116820869BActive Publication Date: 2026-07-31BAIRONG FINANCIAL INFORMATION SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BAIRONG FINANCIAL INFORMATION SERVICE CO LTD
Filing Date
2022-03-21
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The existing scheduling system lacks unified monitoring of the task lifecycle, which makes it impossible to detect and handle tasks that are not triggered on time or are triggered multiple times, thus affecting the normal operation of the business.

Method used

This paper provides a task scheduling and monitoring method that generates a scheduling sequence and a monitoring thread to monitor the execution status of tasks in real time, generates monitoring information, and stores the scheduling information in a Redis cache, thereby achieving fine-grained task monitoring and alarms.

Benefits of technology

It enables unified monitoring of task scheduling, improves development efficiency, ensures the stability and reliability of business systems, and can promptly detect issues such as tasks not being triggered on time or being triggered multiple times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116820869B_ABST
    Figure CN116820869B_ABST
Patent Text Reader

Abstract

This application discloses a task scheduling monitoring method, comprising the following steps: generating a scheduling sequence for the target task based on its execution cycle time, start time, and end time, wherein the scheduling sequence records the scheduling times of the target tasks in chronological order; after the target task begins scheduling, starting a monitoring thread related to the target task to obtain the head scheduling time from the scheduling sequence of the target task; if the head scheduling time is earlier than the current time, retrieving the execution record of the target task between the head scheduling time and the head scheduling time plus the execution cycle time from the database; and generating monitoring information based on the execution record. This method enables timed monitoring based on the task scheduling lifecycle and can run independently of the main task scheduling process, resulting in high development efficiency, providing a unified configuration entry point for the system, and facilitating the deployment and implementation of monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of computer networks, and more specifically to a task scheduling and monitoring method. Additionally, this application also relates to related devices, electronic devices, and computer-readable storage media. Background Technology

[0002] With the development of the internet age and the continuous expansion of business, scheduled tasks are used to varying degrees in daily development and data processing. In recent years, with the updates to scheduled task frameworks and the popularization of scheduling systems, the configuration and management of scheduled tasks have become increasingly sophisticated. However, during system operation, various unstable factors or improper use may cause scheduled tasks to fail to execute or execute multiple times, affecting normal business operations and potentially causing varying degrees of impact and losses. For example, when using the Quartz scheduled task framework to implement scheduled tasks, different server time zones may cause tasks to execute simultaneously on multiple servers, or system crashes or network issues may prevent tasks from being scheduled correctly, thus affecting business operations. Therefore, it is necessary to monitor the configured scheduled tasks. When a scheduled task fails to trigger on time or triggers multiple times, the relevant personnel should be notified for follow-up and handling to ensure the normal operation of the business.

[0003] Existing scheduling systems lack methods for monitoring the lifecycle of scheduled tasks. Most monitoring focuses on the task level, such as task failures or timeouts, but neglects other scenarios, such as tasks failing to trigger or being triggered multiple times. In enterprise applications, the use of various scheduled tasks is inevitable. Each system requires separate task monitoring configurations, lacking a unified configuration entry point. If some systems lack monitoring, task failures cannot be detected immediately, impacting normal business operations. Furthermore, scheduled tasks used in applications may not log information in some cases, making troubleshooting difficult when tasks malfunction.

[0004] The background description is provided for the purpose of understanding the relevant technologies in this field and is not intended as an admission of prior art. Summary of the Invention

[0005] Therefore, this invention aims to provide a task scheduling and monitoring method that offers a unified configuration entry point for task scheduling and monitoring, provides finer-grained monitoring rules, and allows task scheduling and monitoring to run independently, resulting in high development and deployment efficiency. Specifically, this invention provides a task scheduling and monitoring method, including the following steps:

[0006] Based on the execution cycle time, start time, and end time of the target task, a scheduling sequence for the target task is generated, wherein the scheduling time of the target task is recorded in chronological order in the scheduling sequence.

[0007] After the target task begins scheduling, a monitoring thread related to the target task is started to obtain the head scheduling time from the scheduling sequence of the target task.

[0008] If the head scheduling time is earlier than the current time, retrieve the execution record of the target task between the head scheduling time and the head scheduling time plus the execution cycle time from the database;

[0009] Based on the execution records, monitoring information is generated.

[0010] In some embodiments of the present invention, after generating monitoring information, the method further includes:

[0011] Delete the head scheduling time from the scheduling sequence of the target task, and take the next scheduling time in the scheduling sequence as the head scheduling time.

[0012] In some embodiments of the present invention, it further includes:

[0013] If the next scheduling time is empty and the current time is earlier than the end time, the scheduling sequence of the target task is updated according to the execution cycle of the target task, the current time, and the end time.

[0014] In some embodiments of the present invention, it further includes:

[0015] If the next scheduling time is empty and the current time is later than the end time, delete the scheduling sequence of the target task and stop the monitoring thread.

[0016] In some embodiments of the present invention, it further includes:

[0017] When the target task is scheduled for execution, the execution record of the target task reported by the client is received and stored in the database. The execution record includes the identifier of the target task, the start time of the target task, and the execution machine information of the target task.

[0018] In some embodiments of the present invention, generating the scheduling sequence of the target task includes:

[0019] Generate key-value pairs based on the target task's business code, target task identifier, start time, end time, and execution cycle time;

[0020] Based on the start time of the target task, the execution cycle time is successively added together to generate the scheduling sequence of the target task, and the scheduling sequence of the target task is used as the content value;

[0021] The key and content value are inserted as a key-value pair into the Redis cache.

[0022] In some embodiments of the present invention, obtaining the head scheduling time from the scheduling sequence of the target task includes:

[0023] Based on the information of the target task, the scheduling sequence of the target task is obtained from the Redis cache, and the first scheduling time in the scheduling sequence of the target task is obtained as the head scheduling time.

[0024] In some embodiments of the present invention, it further includes:

[0025] If the head scheduling time is determined to be later than the current time, the monitoring thread sleep threshold time is set.

[0026] In some embodiments of the present invention, generating monitoring information includes:

[0027] An alarm message is generated when the number of times the target task is executed is 0 or greater than 1.

[0028] When the number of times the target task is executed is determined to be 1, the status information of the target task is monitored.

[0029] In this embodiment of the invention, a task scheduling and monitoring device is also provided, comprising:

[0030] A scheduling sequence generation unit is configured to generate a scheduling sequence for the target task based on the execution cycle time, start time, and end time of the target task, wherein the scheduling sequence records the scheduling time of the target task in chronological order.

[0031] The head scheduling time acquisition unit is configured to start a monitoring thread related to the target task after the target task starts scheduling, and acquire the head scheduling time from the scheduling sequence of the target task.

[0032] An execution record acquisition unit is configured to, when it is determined that the header scheduling time is earlier than the current time, acquire the execution record of the target task between the header scheduling time and the header scheduling time plus the execution cycle time from the database;

[0033] A monitoring information generation unit is configured to generate monitoring information based on the execution record.

[0034] In this embodiment of the invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the task scheduling and monitoring method of any embodiment of the invention.

[0035] In an embodiment of the present invention, an electronic device is provided, comprising: a processor and a memory storing a computer program, wherein the processor is configured to execute the task scheduling and monitoring method of any embodiment of the present invention when running the computer program.

[0036] This invention proposes a method and apparatus for task scheduling monitoring. It can perform periodic monitoring based on the task scheduling lifecycle and can run independently of the main task scheduling process. This results in high development efficiency, provides a unified configuration entry point for the system, facilitates monitoring deployment and implementation, and enables rapid execution of fine-grained monitoring rules. It also has fewer dependent components and higher stability. The task scheduling monitoring method in this invention can monitor for issues such as scheduled tasks not being triggered on time or being triggered multiple times.

[0037] Other optional features and technical effects of the embodiments of the present invention are partly described below and partly apparent from reading this document. Attached Figure Description

[0038] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The elements shown are not limited to the scale shown in the drawings, and the same or similar reference numerals in the drawings denote the same or similar elements, wherein:

[0039] Figure 1 The system architecture diagram of the task scheduling and monitoring system is shown;

[0040] Figure 2 An exemplary flowchart of a task scheduling and monitoring method according to an embodiment of the present invention is shown;

[0041] Figure 3 An exemplary flowchart illustrating the generation of a scheduling sequence in a task scheduling monitoring method according to an embodiment of the present invention is shown.

[0042] Figure 4 An exemplary flowchart of a task scheduling and monitoring method according to other embodiments of the present invention is shown;

[0043] Figure 5 An exemplary flowchart of a task scheduling and monitoring method according to other embodiments of the present invention is shown;

[0044] Figure 6 A schematic diagram of the structure of a task scheduling and monitoring device according to an embodiment of the present invention is shown;

[0045] Figure 7An exemplary structural schematic diagram of an electronic device capable of implementing the method according to an embodiment of the present invention is shown. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0047] In this embodiment of the invention, "Redis" refers to a distributed caching system that uses a key-value approach to store information; "zset" refers to a data storage type in the Redis caching system, where each element is assigned a score representing a weight; "SpringBoot" refers to an open-source application framework that provides a container with inversion of control features, which resolves version conflicts of dependency packages by integrating a large number of frameworks; and "jar package" refers to a software package file format, typically used to aggregate a large number of Java class files, related metadata, and resource (text, images, etc.) files into one file for developing Java platform application software or libraries.

[0048] like Figure 1 As shown, the task scheduling and monitoring system in this embodiment of the invention includes a server and a client. The client collects information from various business systems and reports it to the server. The server stores the reported information in the database MySQL and runs a monitoring thread to read the task scheduling sequence from Redis, retrieve the task execution record from MySQL, and generate monitoring information.

[0049] The task scheduling and monitoring system provided in this embodiment of the invention aims to provide a unified monitoring entry point for other business systems, mainly solving the problem of tasks not being scheduled normally due to the inherent unreliability of the scheduling system and other external factors. The system in this embodiment of the invention consists of two parts: a client and a server. The client is responsible for collecting task information and sending the collected information to the server. The server is responsible for task monitoring, alarms, log queries, and other information.

[0050] After configuring periodic scheduling tasks in other business systems, the system client collects task information, mainly including business code, task ID, scheduling start time, end time, execution cycle, and scheduling manager. The client sends the information to the server, which monitors the task. At the same time, the client is responsible for collecting log information and reporting it to the server, which is responsible for saving the logs to the MySQL database.

[0051] The monitoring is implemented as follows:

[0052] A1. Calculate the trigger times of the task in the last 30 execution cycles. Store these trigger times in Redis. The key in Redis is the business code + task ID + start time + end time + execution cycle + CRON (time cycle expression), and the value is the trigger times of the last 30 times. One task corresponds to one key. The start and end times refer to the scheduling effective and stop times set for the task. For example, if the specified task scheduling time range is from March 1st to April 1st, 2022, and the scheduling cycle is days, then the Redis key is: CODE_ID123_20220301_20220401_DAY_(0 0 0**?*), and the value is the scheduling time sequence ['2022-03-01 00:00:00', '2022-03-02 00:00:00', ......] stored in zset format, with a uniform weight of 1.

[0053] A2. During task scheduling and execution, the client reports task execution information, including task ID, task start time, and execution machine information. After being reported to the server, the server persists this information to the database. By default, it saves execution records for the past three months.

[0054] A3. After the scheduling task begins, the monitoring program starts a thread to monitor the task and retrieves the header trigger time stored in Redis. If the header trigger time is later than or equal to the current time, it means the task has not yet reached its execution time, and the thread sleeps for 10 seconds or another duration. If the header trigger time is earlier than the current time, the program queries the database for the execution record of the current task. The query is based on the time range, and records within the range of the header trigger time and the next trigger time correspond to the execution record of the current task. If the task has not been executed, it means the task triggering has failed. If multiple records are found, it means the task has been triggered multiple times, and an alarm message is sent. If a task record is found, the program monitors the task status information.

[0055] A4. After executing the last monitoring rule, remove the header trigger time of the corresponding key from the scheduling time sequence, and use the next trigger time as the header trigger time. When the scheduling time sequence is empty, initialize the last 30 trigger times in Redis according to the task scheduling cycle. If the next trigger time of the scheduled task is empty, it means that the task has expired. Then delete the key from Redis and stop the monitoring thread.

[0056] When a business system uses the system in this embodiment of the invention, it imports the corresponding JAR file, and the system can automatically collect log information and configuration information from the business system. The server is deployed using Spring Boot; after packaging, the monitoring system in this embodiment of the invention can be run by starting it with java-jar.

[0057] The task scheduling and monitoring system in this embodiment of the invention provides a unified configuration entry point and more granular monitoring rules, especially for scenarios where scheduled tasks are not triggered on time or are triggered multiple times due to external factors; it collects logs generated during the scheduling process and records them in the database, making it convenient for developers and maintenance personnel to troubleshoot problems; business systems do not need to worry about task monitoring, improving development efficiency; it is implemented based on Redis, has fewer dependent components, and is highly stable.

[0058] like Figure 2 As shown, this embodiment of the invention also provides a task scheduling and monitoring method, including the following steps:

[0059] S110. Generate a scheduling sequence for the target task based on its execution cycle time, start time, and end time. The scheduling sequence records the scheduling times of the target tasks in chronological order. This embodiment of the invention generates a scheduling sequence based on the execution cycle, start time, and end time, facilitating the retrieval of the planned execution time. For example, if the execution cycle time is 1 day, the start time is March 1, 2022, and the end time is May 1, 2022, the corresponding scheduling sequence is 2022-03-01, 2022-03-02, 2022-03-03, ..., 2022-05-01. In some embodiments, in order to appropriately reduce the length of the scheduling sequence and reduce the amount of data, the scheduling sequence can be generated based on the execution times of the last 20 or 30 executions. For example, the scheduling sequence is 2022-03-01, 2022-03-02, 2022-03-03, ..., 2022-03-20. After the task is executed on March 20, 2022, the scheduling sequence is generated again based on the execution times of the last 20 tasks. At this time, the scheduling sequence is 2022-03-21, 2022-03-22, ..., 2022-04-09, until the end time is reached.

[0060] The monitoring method in this embodiment of the invention can monitor multiple task schedules. To facilitate reading the execution time of each task, the scheduling sequence can be stored in a Redis cache using key-value pairs, making it easy to retrieve the scheduling sequence based on the key value later. Specifically, as shown... Figure 3 As shown, the steps for generating the scheduling sequence of the target task include:

[0061] S111. Generate a key value based on the business code, identifier, start time, end time, and execution cycle time of the target task. For example, if the business code is CODE, the identifier of the target task is ID123, the start time is March 1, 2022, the end time is April 1, 2022, and the execution cycle is days, then the corresponding key value is CODE_ID123_20220301_20220401_DAY. In some embodiments, a Cron expression is added to express the execution cycle when generating the key value. In this case, the above key value is CODE_ID123_20220301_20220401_DAY_(0 0 0**?*), and the Cron expression (0 00**?*) indicates that the task is executed every 0 hours, 0 minutes, and 0 seconds.

[0062] S112. Based on the start time of the target task, the execution cycle time is successively added together to generate the scheduling sequence of the target task, and the scheduling sequence of the target task is used as the content value; for example, based on the above key value, the scheduling sequence is ['2022-03-01 00:00:00','2022-03-02 00:00:00',......].

[0063] S113. Insert the key-value pair and content-value pair into the Redis cache. In some embodiments, the scheduling sequence is stored in zset format for easy and fast retrieval.

[0064] S120. After the target task begins scheduling, a monitoring thread related to the target task is started to obtain the head scheduling time from the scheduling sequence of the target task. The target task is executed according to the time in the scheduling sequence. Different monitoring threads can be started for different tasks to perform monitoring. In some embodiments of the present invention, obtaining the head scheduling time from the scheduling sequence of the target task includes:

[0065] Based on the information of the target task, the scheduling sequence of the target task is obtained from the Redis cache, and the first scheduling time in the scheduling sequence is taken as the header scheduling time. For example, the scheduling sequence is ['2022-03-01 00:00:00', '2022-03-02 00:00:00', ...], and the header scheduling time is '2022-03-01 00:00:00'.

[0066] In some embodiments of the present invention, during the scheduling and execution of the target task, the client collects information from the business system. The monitoring method in these embodiments further includes:

[0067] S120-p receives the execution record of the target task reported by the client and stores it in the database. The execution record includes the identifier of the target task, the start time of the target task, and the execution machine information of the target task.

[0068] In some embodiments, the storage of execution records and the execution of monitoring threads can run independently. In some embodiments, the storage of execution records can also be performed using threads.

[0069] S130. If it is determined that the head scheduling time is earlier than the current time, retrieve the execution record of the target task between the head scheduling time and the execution cycle time from the database; for example, if the scheduling sequence is ['2022-03-01 00:00:00', '2022-03-02 00:00:00', ...], the current time is 2022-03-01 00:03:00, the head scheduling time is 2022-03-01 00:00:00, then the head scheduling time is earlier than the current time, the head scheduling time plus the execution cycle time is 2022-03-02 00:00:00, and the retrieved execution record is the record between 2022-03-01 00:00:00 and 2022-03-02 00:00:00.

[0070] In some embodiments of the present invention, the monitoring method further includes:

[0071] S130b determines that the header scheduling time is later than the current time, and sets a sleep threshold time for the monitoring thread. This indicates that the task has not yet started execution, and the monitoring thread can sleep. The sleep time can be set according to the threshold or the difference between the header scheduling time and the current time. For example, if the header scheduling time is 2022-03-01 00:00:00 and the current time is 2022-02-28 23:59:30, the thread can be set to sleep for 10 seconds based on the threshold time of 10 seconds, and then the judgment can be made again. Alternatively, the thread can be set to sleep for 35 seconds based on the time difference of 30 seconds.

[0072] S140. Based on the execution record, generate monitoring information.

[0073] In some embodiments, generating monitoring information includes:

[0074] S141. When the number of times the target task is executed is 0 or greater than 1, generate an alarm message; when the number of execution records is 0, it means that the task has not been executed; when the number of execution records is greater than 1, it means that the task has been executed multiple times and an alarm should be triggered.

[0075] S142. When the number of executions of the target task is determined to be 1, monitor the status information of the target task. Monitor the execution status of the target task and determine whether each execution parameter exceeds the threshold. If it does, an alarm is triggered. For example, in some distributed storage tasks, if it is determined that the machines executing the task are too concentrated, an alarm message is generated to prompt the machines to perform load balancing.

[0076] The monitoring method in the embodiments of the present invention runs continuously. After generating monitoring information values ​​and updating the scheduling sequence in this execution, the monitoring thread is called again to perform monitoring. Specifically, after generating monitoring information, such as... Figure 4 As shown, it also includes:

[0077] S150. Delete the head scheduling time from the scheduling sequence of the target task, and use the next scheduling time after the head scheduling time in the scheduling sequence as the head scheduling time. For example, if the scheduling sequence is ['2022-03-01 00:00:00', '2022-03-02 00:00:00', ...], the head scheduling time during the first execution is '2022-03-01 00:00:00'. After the monitoring task is completed, delete '2022-03-01 00:00:00', and use '2022-03-02 00:00:00' as the head scheduling time. Then, read the execution record and generate monitoring information.

[0078] After the corresponding monitoring task in the scheduling sequence is executed, the scheduling sequence can be updated based on the end time. Specifically, for example... Figure 5 As shown, the monitoring method in this embodiment of the invention further includes:

[0079] S160a. If it is determined that the next scheduling time is empty and the current time is earlier than the end time, the scheduling sequence of the target task is updated according to the execution cycle time of the target task, the current time and the end time. For example, if the key value is CODE_ID123_20220301_20220401_DAY_(0 0 0**?*), and the initial scheduling sequence is ['2022-03-01 00:00:00', '2022-03-02 00:00:00', ... '2022-03-15 00:00:00'], after multiple executions, the scheduling sequence is updated to ['2022-03-15 00:00:00']. The next scheduling time is then empty. The current time is 2022-03-15 00:03:00. Based on the end time 20220401 and an execution cycle of 1 day, the regenerated scheduling sequence is ['2022-03-16 00:00:00', '2022-03-17 00:00:00']. [00:00:00',…'2022-04-01 00:00:00'], continue executing the monitoring thread.

[0080] In some embodiments, after the end time is reached, the monitoring thread is stopped, released, and deleted. Specifically, the monitoring method in this embodiment of the invention further includes:

[0081] S160b: If the next scheduled time is empty and the current time is later than the end time, delete the scheduling sequence of the target task and stop the monitoring thread. For example, if the corresponding key value is CODE_ID123_20220301_20220401_DAY_(0 0 0**?*), the initial scheduling sequence is ['2022-03-01 00:00:00', '2022-03-02 00:00:00', ... '2022-04-01 00:00:00'], the updated scheduling sequence is ['2022-04-01 00:00:00'], the current time is 2022-04-01 00:03:00, the next scheduled time is empty, and the current time is later than the end time, then the task monitoring is complete, the monitoring thread is stopped, and the monitoring thread is deleted.

[0082] The task scheduling and monitoring method in this embodiment of the invention provides a unified configuration entry point and more granular monitoring rules, especially for scenarios where scheduled tasks are not triggered on time or are triggered multiple times due to external factors; it collects logs generated during the scheduling process and records them in the database, making it convenient for developers and maintenance personnel to troubleshoot problems; business systems do not need to worry about task monitoring, improving development efficiency; it is implemented based on Redis, has fewer dependent components, and is highly stable.

[0083] In embodiments of the present invention, such as Figure 6 As shown, a task scheduling and monitoring device 600 includes:

[0084] The scheduling sequence generation unit 610 is configured to generate a scheduling sequence for the target task based on the execution cycle time, start time, and end time of the target task, wherein the scheduling sequence records the scheduling time of the target task in chronological order.

[0085] Head scheduling time acquisition unit 620 is configured to start a monitoring thread related to the target task after the target task starts scheduling, and acquire the head scheduling time from the scheduling sequence of the target task.

[0086] The execution record acquisition unit 630 is configured to acquire the execution record of the target task between the head scheduling time and the execution cycle time from the database when it is determined that the head scheduling time is earlier than the current time.

[0087] A monitoring information generation unit 640 is configured to generate monitoring information based on the execution record.

[0088] The device 600 in this embodiment of the invention further includes:

[0089] The head scheduling time update unit 650 is configured to delete the head scheduling time from the scheduling sequence of the target task and use the next scheduling time of the head scheduling time in the scheduling sequence as the head scheduling time.

[0090] The device 600 in this embodiment of the invention further includes:

[0091] The scheduling sequence update unit 660 is configured to update the scheduling sequence of the target task according to the execution cycle of the target task, the current time, and the end time when it is determined that the next scheduling time is empty and the current time is earlier than the end time.

[0092] The scheduling sequence update unit 660 in the apparatus 600 of this embodiment is further configured to:

[0093] If the next scheduling time is empty and the current time is later than the end time, delete the scheduling sequence of the target task and stop the monitoring thread.

[0094] The device 600 in this embodiment of the invention further includes:

[0095] The execution record storage unit 670 is configured to receive the execution record of the target task reported by the client and store it in the database when the target task is scheduled to be executed. The execution record includes the identifier of the target task, the start time of the target task, and the execution machine information of the target task.

[0096] The scheduling sequence generation unit 610 in this embodiment of the invention is specifically configured as follows:

[0097] Generate key-value pairs based on the target task's business code, target task identifier, start time, end time, and execution cycle time;

[0098] Based on the start time of the target task, the execution cycle time is successively added together to generate the scheduling sequence of the target task, and the scheduling sequence of the target task is used as the content value;

[0099] The key and content value are inserted as a key-value pair into the Redis cache.

[0100] In the apparatus 600 of this embodiment, the head scheduling time acquisition unit 620 is specifically configured as follows:

[0101] Based on the information of the target task, the scheduling sequence of the target task is obtained from the Redis cache, and the first scheduling time in the scheduling sequence of the target task is obtained as the head scheduling time.

[0102] In the apparatus 600 of this embodiment, the execution record acquisition unit is further configured to:

[0103] If the head scheduling time is determined to be later than the current time, the monitoring thread sleep threshold time is set.

[0104] In the apparatus 600 of this embodiment, the monitoring information generation unit 640 is specifically configured as follows:

[0105] An alarm message is generated when the number of times the target task is executed is 0 or greater than 1.

[0106] When the number of times the target task is executed is determined to be 1, the status information of the target task is monitored.

[0107] In some embodiments, the task scheduling and monitoring device may combine the features of any of the task scheduling and monitoring methods and systems of the embodiments, and vice versa, which will not be elaborated here.

[0108] In an embodiment of the present invention, an electronic device is provided, comprising: a processor and a memory storing a computer program, wherein the processor is configured to execute the task scheduling and monitoring method of any embodiment of the present invention when running the computer program.

[0109] Figure 7 The diagram illustrates a method or electronic device 700 that can implement embodiments of the present invention. In some embodiments, it may include more or fewer electronic devices than illustrated. In some embodiments, it may be implemented using a single or multiple electronic devices. In some embodiments, it may be implemented using cloud-based or distributed electronic devices.

[0110] like Figure 7 As shown, the electronic device 700 includes a central processing unit (CPU) 701, which can perform various appropriate operations and processes based on programs and / or data stored in read-only memory (ROM) 702 or programs and / or data loaded from storage portion 708 into random access memory (RAM) 703. The CPU 701 can be a multi-core processor or may contain multiple processors. In some embodiments, the CPU 701 may include a general-purpose main processor and one or more special coprocessors, such as a graphics processing unit (GPU), a neural network processor (NPU), a digital signal processor (DSP), etc. Various programs and data required for the operation of the electronic device 700 are also stored in RAM 703. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0111] The processor and memory described above are used together to execute the program stored in the memory. When the program is executed by the computer, it can implement the steps or functions of the training method, high-resolution audio generation method, and sound effect switching method of the high-resolution audio generation model described in the above embodiments.

[0112] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, touchscreen, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed. Figure 7 The diagram only shows a portion of the components and does not imply that the computer system 700 includes only a portion of the components. Figure 7 The components shown.

[0113] In some embodiments, the electronic device 700 refers to a mobile terminal, including mobile phones, vehicle terminals, smart TVs, etc. Taking a mobile phone as an example, the electronic device 700 also includes a touch screen, external speaker, gyroscope, camera, 4G / 5G antenna, and other device modules.

[0114] The systems, devices, modules, or units described in the above embodiments can be implemented by a computer or its associated components. The computer may be, for example, a mobile terminal, smartphone, personal computer, laptop computer, in-vehicle human-machine interface device, personal digital assistant, media player, navigation device, game console, tablet computer, wearable device, smart TV, Internet of Things system, smart home, industrial computer, server, or a combination thereof.

[0115] Although not shown, in an embodiment of the invention, a storage medium is provided storing a computer program configured to be executed, when run, to perform the task scheduling and monitoring method of any embodiment of the invention.

[0116] Storage media in embodiments of the present invention include articles that are permanent and non-permanent, removable and non-removable, capable of storing information by any method or technology. Examples of storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0117] The methods, programs, systems, apparatuses, etc., in embodiments of the present invention can be executed or implemented in one or more networked computers, or practiced in a distributed computing environment. In the embodiments of this specification, in these distributed computing environments, tasks can be performed by remote processing devices connected via a communication network.

[0118] Those skilled in the art will understand that the embodiments described in this specification can be provided as methods, systems, or computer program products. Therefore, those skilled in the art will realize that the functional modules / units or controllers and related method steps described in the above embodiments can be implemented in software, hardware, or a combination of both.

[0119] Unless explicitly stated otherwise, the actions or steps of the methods and procedures described in the embodiments of the present invention do not necessarily have to be performed in a specific order and can still achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0120] This document describes several embodiments of the present invention; however, for the sake of brevity, the descriptions of the embodiments are not exhaustive, and identical or similar features or parts between the embodiments may be omitted. In this document, "one embodiment," "some embodiments," "example," "specific example," or "some examples" refers to embodiments applicable to at least one, but not all, of the present invention. The above terms do not necessarily refer to the same embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described herein, as well as the features of the different embodiments or examples.

[0121] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are merely examples of the best mode for implementing the systems and methods. Those skilled in the art will understand that various changes can be made to the embodiments of the systems and methods described herein without departing from the spirit and scope of the invention as defined in the appended claims when implementing the systems and / or methods.

Claims

1. A method of task scheduling monitoring, the method comprising: Includes the following steps: Based on the execution cycle time, start time, and end time of the target task, a scheduling sequence for the target task is generated, wherein the scheduling time of the target task is recorded in chronological order in the scheduling sequence; After the target task begins scheduling, a monitoring thread related to the target task is started to obtain the head scheduling time from the scheduling sequence of the target task. If the head scheduling time is earlier than the current time, retrieve the execution record of the target task between the head scheduling time and the head scheduling time plus the execution cycle time from the database; Based on the execution records, monitoring information is generated.

2. The method of claim 1, wherein, After generating monitoring information, the following is also included: Delete the head scheduling time from the scheduling sequence of the target task, and take the next scheduling time in the scheduling sequence as the head scheduling time.

3. The method of claim 2, wherein, Also includes: If the next scheduling time is empty and the current time is earlier than the end time, the scheduling sequence of the target task is updated according to the execution cycle of the target task, the current time, and the end time.

4. The method of claim 3, wherein, Also includes: If the next scheduling time is empty and the current time is later than the end time, delete the scheduling sequence of the target task and stop the monitoring thread.

5. The method of claim 1, wherein, Also includes: When the target task is scheduled for execution, the execution record of the target task reported by the client is received and stored in the database. The execution record includes the identifier of the target task, the start time of the target task, and the execution machine information of the target task.

6. The method of claim 1, wherein, The generation of the scheduling sequence for the target task includes: Generate key-value pairs based on the target task's business code, target task identifier, start time, end time, and execution cycle time; Based on the start time of the target task, the execution cycle time is successively added together to generate the scheduling sequence of the target task, and the scheduling sequence of the target task is used as the content value; The key and content value are inserted as a key-value pair into the Redis cache.

7. The method of claim 6, wherein, The step of obtaining the head scheduling time from the scheduling sequence of the target task includes: Based on the information of the target task, the scheduling sequence of the target task is obtained from the Redis cache, and the first scheduling time in the scheduling sequence of the target task is obtained as the head scheduling time.

8. The method of claim 1, wherein, Also includes: If the head scheduling time is determined to be later than the current time, the monitoring thread sleep threshold time is set.

9. The method of claim 1-8, wherein, The generated monitoring information includes: An alarm message is generated when the number of times the target task is executed is 0 or greater than 1. When the number of times the target task is executed is determined to be 1, the status information of the target task is monitored.

10. A task scheduling monitoring apparatus characterized by comprising: include: A scheduling sequence generation unit is configured to generate a scheduling sequence for the target task based on the execution cycle time, start time, and end time of the target task, wherein the scheduling sequence records the scheduling time of the target task in chronological order. The head scheduling time acquisition unit is configured to start a monitoring thread related to the target task after the target task starts scheduling, and acquire the head scheduling time from the scheduling sequence of the target task. An execution record acquisition unit is configured to, when it is determined that the header scheduling time is earlier than the current time, acquire the execution record of the target task between the header scheduling time and the header scheduling time plus the execution cycle time from the database; A monitoring information generation unit is configured to generate monitoring information based on the execution record.

11. A computer readable storage medium having stored thereon a computer program, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1-9.

12. An electronic device, comprising: include: A processor and a memory storing a computer program, the processor being configured to perform the method of any one of claims 1-9 when running the computer program.