Scheduled task control method, device, medium and computer equipment

Unified management of scheduled tasks through configuration management tables solves the problems of difficulty in managing scheduled tasks and low development efficiency, and achieves real-time effectiveness and efficient management of scheduled tasks.

CN110471750BActive Publication Date: 2024-09-24PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910631651.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-12
Publication Date
2024-09-24
Estimated Expiration
2039-07-12

AI Technical Summary

Technical Problem

In the existing technology, the management of scheduled tasks is more difficult, there is too much configuration information in the configuration file, and frequent server restarts are required to modify scheduled tasks, which reduces project development efficiency.

Method used

Unify the management of scheduled tasks through the configuration management table, obtain the current system time, query configuration information, determine and execute new configuration information, and use the reflection mechanism to create or modify scheduled tasks to avoid restarting the server to take effect.

Benefits of technology

It achieves unified management of multiple scheduled tasks, reduces management difficulty, and improves project development efficiency. The control operations of scheduled tasks can take effect in real time, without the need to frequently restart the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The present invention provides a method, device, computer storage medium and computer equipment for controlling a scheduled task; the method comprises: obtaining the current system time; when the current system time satisfies the preset time execution strategy, querying a configuration management table for recording the configuration information of the scheduled task to obtain a query result, the query result including the current configuration information; judging whether the configuration management table includes new configuration information according to the query result; if included, obtaining the new configuration information and executing the new configuration information. Through the technical solution of the present invention, it is possible to achieve unified management of multiple scheduled tasks, reduce the difficulty of managing scheduled tasks, and help improve the development efficiency of the project.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of system control, and in particular to a timed task control method, device, medium and computer equipment. Background Art

[0002] Scheduled tasks are a technology widely used in various projects. When applying scheduled tasks, you need to configure in advance the task content to be executed when the scheduled task is triggered, as well as the time execution strategy used to determine whether to trigger the scheduled task. When the time execution strategy is met, the scheduled task is triggered and the task content of the scheduled task is executed.

[0003] At present, the configuration of scheduled tasks is usually that the administrator configures the number of scheduled tasks required by the project one by one in the configuration file, that is, each scheduled task corresponds to a configuration information. As the number of scheduled tasks increases, more and more configuration information is required in the configuration file. In addition, if you want to modify the configured scheduled tasks, the administrator needs to find the target configuration information from the large amount of configuration information contained in the configuration file before you can modify it. In order to make the modified configuration file take effect, you need to restart the server, which is very cumbersome.

[0004] As the number of scheduled tasks that require new configuration and modification increases, the difficulty of managing a large number of scheduled tasks becomes increasingly greater. On the other hand, modifications to scheduled tasks also require frequent server restarts, which greatly reduces the project development efficiency. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a scheduled task control method, device, medium and computer equipment. Through the technical solution of the present invention, unified management of multiple scheduled tasks can be achieved, the difficulty of managing scheduled tasks is reduced, and it is beneficial to improve the development efficiency of the project.

[0006] According to a first aspect, an embodiment of the present invention provides a timed task control method, including:

[0007] Get the current system time;

[0008] When the current system time satisfies the preset time execution strategy, querying a configuration management table for recording configuration information of scheduled tasks to obtain a query result, wherein the query result includes the current configuration information;

[0009] Determine whether the configuration management table contains new configuration information according to the query result;

[0010] If included, the new configuration information is obtained and executed.

[0011] Further, receiving a user's scheduled task creation instruction;

[0012] Obtaining configuration information associated with the scheduled task creation instruction;

[0013] Fill the configuration information into the configuration management table according to preset information filling rules.

[0014] Further, receiving a scheduled task modification instruction from a user, wherein the scheduled task modification instruction is associated with the configuration modification information input by the user and the identifier of the task to be modified;

[0015] The configuration information corresponding to the task identifier to be modified in the configuration management table is modified according to the configuration modification information.

[0016] Further, judging whether the configuration management table contains new configuration information according to the query result includes:

[0017] Get the historical configuration information obtained from the last query of the configuration management table;

[0018] Comparing the current configuration information contained in the query result with the historical configuration information;

[0019] If the current configuration information is consistent with the historical configuration information, it is determined that the configuration management table does not contain new configuration information;

[0020] If the current configuration information is inconsistent with the historical configuration information, it is determined that the configuration management table contains new configuration information, and the current configuration information is used as the new configuration information.

[0021] Furthermore, the comparing the current configuration information contained in the query result with the historical configuration information further includes:

[0022] Comparing the task identification information in the current configuration information with the task identification information in the historical configuration information;

[0023] If the comparison is inconsistent, determining that the configuration type corresponding to the current configuration information is to create a scheduled task;

[0024] If the comparison is consistent, comparing the task status information in the current configuration information with the task status information in the historical configuration information;

[0025] If the comparison is inconsistent, it is determined that the configuration type corresponding to the current configuration information is to delete the scheduled task.

[0026] Further, the executing the new configuration information includes:

[0027] If the configuration type corresponding to the new configuration information is to create a scheduled task, extracting the task implementation class path information from the new configuration information;

[0028] Acquire a task implementation base class according to the task implementation class path information;

[0029] The new configuration information is used as a parameter of the scheduled task implementation base class by utilizing a reflection mechanism to obtain a scheduled task class, and a new scheduled task is created based on the scheduled task class.

[0030] Further, obtaining current configuration information in the query result;

[0031] The current configuration information is stored in a preset database according to a preset storage format.

[0032] According to a second aspect, an embodiment of the present invention provides a timed task control device, including:

[0033] Time acquisition module, used to obtain the current system time;

[0034] A management table query module, used to query a configuration management table for recording configuration information of scheduled tasks to obtain a query result when the current system time meets the preset time execution strategy, wherein the query result includes the current configuration information;

[0035] A judgment module, used for judging whether the configuration management table contains new configuration information according to the query result;

[0036] The execution module is used to obtain new configuration information when the configuration management table contains new configuration information, and execute the new configuration information.

[0037] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned scheduled task control method is implemented.

[0038] According to a fourth aspect, an embodiment of the present invention provides a computer device, the computer device comprising:

[0039] one or more processors;

[0040] A storage device for storing one or more programs;

[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned scheduled task control method.

[0042] In an embodiment of the present invention, by obtaining the current system time; when the current system time meets the preset time execution strategy, querying the configuration management table used to record the configuration information of the scheduled task to obtain a query result, the query result includes the current configuration information; judging whether the configuration management table includes new configuration information according to the query result; if included, obtaining the new configuration information, and executing the new configuration information, it is possible to uniformly control all scheduled tasks in the project through the configuration management table, including creating scheduled tasks, deleting or modifying existing scheduled tasks, etc., which greatly reduces the difficulty of managing scheduled tasks; and the control operations on scheduled tasks can take effect in real time, without the need to frequently restart the server, which is conducive to improving the development efficiency of the project.

[0043] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0045] Figure 1 A schematic diagram of a timed task control method according to an embodiment of the present invention;

[0046] Figure 2 A schematic diagram of the structure of a timing task control device according to an embodiment of the present invention;

[0047] Figure 3 A schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0049] Those skilled in the art can understand that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms, and the "first" and "second" used herein are only used to distinguish the same technical features, and do not limit the order and quantity of the technical features. It should be further understood that the term "comprising" used in the specification of the present invention means the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0050] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0051] The embodiment of the present invention provides a timed task control method, and the specific implementation of the present invention is described in detail below with reference to the accompanying drawings. Figure 1 As shown, the timed task control method provided by the embodiment of the present invention includes the following steps:

[0052] S110: Get the current system time;

[0053] S120: When the current system time satisfies the preset time execution strategy, query the configuration management table for recording the configuration information of the scheduled task to obtain a query result, wherein the query result includes the current configuration information;

[0054] S130: judging whether the configuration management table contains new configuration information according to the query result;

[0055] S140: If included, obtain the new configuration information and execute the new configuration information.

[0056] In this embodiment, considering that when the number of scheduled tasks that need to be newly configured and modified in the project increases, the difficulty of managing a large number of scheduled tasks also becomes greater and greater. In order to better manage the scheduled tasks in the project, this embodiment pre-configures a general scheduling scheduled task for unified management of other scheduled tasks, and configures the preset time execution strategy for the general scheduling scheduled task, wherein the time execution strategy can be a time expression, and it is possible to set the time execution strategy to be executed every N time. The task content of the general scheduling scheduled task is to query the configuration management table pre-configured by the administrator, and determine whether the configuration management table contains new configuration information. If new configuration information is found, the new configuration information is executed, so that new scheduled tasks can be created, and existing scheduled tasks can be deleted or modified through the entry of the general scheduling scheduled task.

[0057] Specifically, when the current system time satisfies the preset time execution strategy corresponding to the general scheduling timed task, the task content corresponding to the general scheduling timed task is executed, that is, the configuration management table is queried, and the configuration management table is pre-configured in the database by the administrator, which records the configuration information corresponding to all scheduled tasks in the project. After querying the configuration management table, it is determined whether the configuration management table contains new configuration information based on the query result currently queried. It should be noted that the new configuration information may refer to the configuration information newly added to the configuration management table for creating a new scheduled task, or it may be the configuration information of the scheduled task already recorded in the configuration management table, but the information on some fields in the configuration information has been modified by the administrator after the last query of the configuration management table.

[0058] More specifically, in this embodiment, the configuration information of all scheduled tasks is configured in the configuration management table stored in the database. Therefore, when new configuration information needs to be added to the configuration management table, or the configuration information of an existing scheduled task in the configuration management table needs to be modified, it is necessary to obtain the modification permission for modifying the data in the database in advance.

[0059] Since the configuration information of scheduled tasks, including the time execution strategy corresponding to the scheduled tasks, is saved in the database, when the configuration information of the scheduled tasks is modified, there is no need to restart the server to make the modified configuration file take effect as in the past. Instead, the modified configuration information can take effect in real time, which can greatly reduce the difficulty of managing scheduled tasks; and the control operations of scheduled tasks can take effect in real time without the need to frequently restart the server, which is conducive to improving the development efficiency of the project.

[0060] The scheduled task control method provided by the present invention also implements adding configuration information to the configuration management table through the following embodiments, including:

[0061] S210: receiving a user's instruction to create a scheduled task;

[0062] S220: Obtain configuration information associated with the scheduled task creation instruction;

[0063] S230: Fill the configuration information into the configuration management table according to preset information filling rules.

[0064] In this embodiment, a configuration interface can be provided for the user to receive the scheduled task creation instruction issued by the user, and to receive the configuration information for creating the scheduled task input by the user through the configuration interface. It can be understood that the association between the scheduled task creation instruction and the configuration information means that the configuration information is included in the scheduled task creation instruction, and it can also mean that the configuration information is not included in the instruction, but is transmitted to the server through another data packet. It should be noted that the user is the above-mentioned administrator.

[0065] After obtaining the configuration information input by the user, the field identifiers corresponding to all the information contained in the configuration information are determined, and then the information on each field is filled into the configuration management table at the same position as its field identifier according to the field identifier.

[0066] In this embodiment, the field identifiers in the configuration information include a task identifier field, a task description field, a task status field, a time execution strategy field, a timed task group field, a trigger group field, and a task implementation class path field, etc. It can be understood that the field identifier corresponding to each configuration information recorded in the configuration management table is the same as the field identifier described above.

[0067] The scheduled task control method provided by the present invention also implements modification of configuration information in the configuration management table through the following embodiments, including:

[0068] S310: receiving a scheduled task modification instruction from a user, wherein the scheduled task modification instruction is associated with the configuration modification information input by the user and the identifier of the task to be modified;

[0069] S320: Modify the configuration information corresponding to the task identifier to be modified in the configuration management table according to the configuration modification information.

[0070] In one embodiment, the scheduled task modification instruction is used to modify the configuration information of an existing scheduled task in the configuration management table.

[0071] Specifically, the user selects the scheduled task to be modified through the configuration page, and the configuration page will display the configuration information corresponding to the scheduled task. Then the user can modify the field information on certain fields in the configuration information on the configuration page.

[0072] Accordingly, the configuration modification information includes the field identifier to be modified selected by the user and the new field information corresponding to the field identifier. The server then modifies the field information corresponding to the field identifier to be modified in the configuration management table to the new field information.

[0073] In another implementation, the scheduled task modification instruction is used to delete an existing scheduled task in the configuration management table.

[0074] In this embodiment, if a user wants to delete a scheduled task, he only needs to modify the task status field in the configuration information of the scheduled task. Specifically, the task status field includes two types: adding a task and canceling a task. A preset threshold can be set for each type of task status to identify it. For example, 0 is preset to indicate adding a task, and 1 indicates canceling a task. If a user wants to delete a scheduled task for sending SMS messages, he only needs to modify the field information on the task status field in the configuration information of the scheduled task, that is, the task status information from 1 to 0, and the scheduled task can be deleted.

[0075] Correspondingly, the configuration modification information includes the field identifier to be modified that the user selects to modify, and new field information corresponding to the field identifier, wherein the field identifier to be modified in this embodiment refers to the task status field, and the new field information refers to the preset threshold indicating joining the task, or the preset threshold indicating canceling the task.

[0076] In one embodiment, since the user only needs to modify the task status field in the configuration information of the scheduled task to delete the scheduled task, the user does not need to enter the field identifier to be modified and the new field information corresponding to the field identifier. The user only needs to issue a scheduled task deletion instruction, which is associated with the task identifier of the scheduled task that the user wants to delete.

[0077] When the server receives a scheduled task deletion instruction issued by the user, it obtains the task identification information associated with the scheduled task deletion instruction, then determines the configuration information corresponding to the task identification information from the configuration management table, and modifies the value of the task status field in the configuration information to a preset threshold indicating task cancellation.

[0078] In one embodiment, the step S130: judging whether the configuration management table contains new configuration information according to the query result includes:

[0079] S131: Obtain the historical configuration information obtained by querying the configuration management table last time;

[0080] S132: Compare the current configuration information included in the query result with the historical configuration information;

[0081] S133: If the current configuration information is consistent with the historical configuration information, it is determined that the configuration management table does not contain new configuration information;

[0082] S134: If the current configuration information is inconsistent with the historical configuration information, it is determined that the configuration management table contains new configuration information, and the current configuration information is used as new configuration information.

[0083] In this embodiment, each time the general scheduling scheduled task queries the configuration management table, it also obtains all the configuration information recorded in the configuration management table and stores all the configuration information.

[0084] Accordingly, it also includes:

[0085] S410: Acquire current configuration information in the query result;

[0086] S420: Store the current configuration information in a preset database according to a preset storage format.

[0087] After the general scheduling timer task queries the configuration management table this time, it obtains all the current configuration information in the query result, and stores all the current configuration information in the preset database according to the preset storage format. The preset storage format refers to determining the time information of this query when storing, and then associating the time information with all the current configuration information for storage.

[0088] It should be noted that the current configuration information may include multiple pieces of configuration information, and the historical configuration information also includes multiple pieces of configuration information.

[0089] Then, when comparing the current configuration information with the historical configuration information, in order to facilitate understanding of the comparison process, the current configuration information can be regarded as a set A containing multiple configuration information, and the historical configuration information can be regarded as a set B containing multiple configuration information. During the comparison process, a piece of configuration information a1 can be taken out from A, and a1 can be compared with each piece of configuration information in B, and the above comparison operation can be repeatedly performed until each piece of configuration information in A is compared with each piece of configuration information in B, and the comparison process is completed.

[0090] After the comparison, if each piece of configuration information in the current configuration information can be matched to the same configuration information in the historical configuration information, then it is determined that no new configuration information is included in the configuration management table.

[0091] If there are several pieces of configuration information in the current configuration information, and there is no configuration information identical to the several pieces of configuration information in the historical configuration information, then it is determined that the configuration management table contains new configuration information, and the new configuration information is the several pieces of configuration information.

[0092] In one embodiment, the S132: comparing the current configuration information included in the query result with the historical configuration information, further includes:

[0093] Comparing the task identification information in the current configuration information with the task identification information in the historical configuration information;

[0094] If the comparison is inconsistent, determining that the configuration type corresponding to the current configuration information is to create a scheduled task;

[0095] If the comparison is consistent, comparing the task status information in the current configuration information with the task status information in the historical configuration information;

[0096] If the comparison is inconsistent, it is determined that the configuration type corresponding to the current configuration information is to delete the scheduled task.

[0097] In this embodiment, the configuration types include creating a scheduled task, deleting a scheduled task, and modifying a scheduled task.

[0098] The configuration information recorded in the configuration management table has a unique task identifier. Therefore, when comparing the current configuration information with the historical configuration information, first compare the task identification information between the two. If they are inconsistent, it can be determined that the two are not the same configuration information, that is, it can be determined that the current configuration information is the configuration information of the scheduled task that the user wants to create, and its corresponding configuration type is to create a scheduled task.

[0099] If the task identification information of the two tasks is consistent, then it can be determined that the two tasks belong to the same scheduled task. Then, it is necessary to compare the field information of the task status field of the two tasks, i.e., the task status information, to determine whether the current configuration information has been modified by the user. Considering that when a user modifies the configuration information of an existing scheduled task, the task status information of the existing scheduled task only needs to be modified when the user wants to delete the existing scheduled task. Therefore, if the comparison finds that the task status information of the two tasks is inconsistent, then it can be determined that the configuration type corresponding to the current configuration information is to delete the scheduled task.

[0100] It is understandable that after determining that the configuration type corresponding to the current configuration information is to create a scheduled task or delete a scheduled task, there is no need to compare other field information of the current configuration information with the historical configuration information. This can effectively reduce the comparison process between the current configuration information and the historical configuration information and improve the comparison efficiency.

[0101] Furthermore, based on the above comparison process, if the comparison finds that the task status information of the two is consistent, it is necessary to further compare the remaining field information of the current configuration information with the remaining field information of the historical configuration information. If the comparison is all consistent, it can be determined that the configuration management table does not contain new configuration information; and if one or some field information is found to be inconsistent after comparison, it can be determined that the configuration type corresponding to the current configuration information is to modify the scheduled task.

[0102] In one embodiment, executing the new configuration information in S140 includes:

[0103] S141: If the configuration type corresponding to the new configuration information is to create a scheduled task, extracting task implementation class path information from the new configuration information;

[0104] S142: Acquire task implementation class data according to the task implementation class path information;

[0105] S143: Using the reflection mechanism, the new configuration information is used as a parameter of the scheduled task implementation base class to obtain a scheduled task class, and a new scheduled task is created according to the scheduled task class.

[0106] It should be noted that in the running state, for any class, all the properties and methods of this class can be obtained, and for any object, any method and property of it (including private methods and properties) can be called. This function of dynamically obtaining information and dynamically calling object methods is the reflection mechanism in the Java language.

[0107] In this embodiment, when executing new configuration information, first determine what configuration type the new configuration information corresponds to. If it is to create a scheduled task, then when executing the new configuration information, obtain the task implementation base class according to the task implementation class path information in the configuration information, wherein the task implementation base class refers to the class that needs to be relied upon when creating a scheduled task, which needs to be pre-written by the administrator and stored in a preset storage area, and the task implementation class path information refers to the address information corresponding to the preset storage area. Furthermore, the task implementation base class is written by the administrator by summarizing the configuration of the scheduled tasks in the project. Depending on the project, the number of task implementation base classes may be different. There may be only one or more. The storage paths of different task implementation base classes are different. In the task implementation class field of the configuration information, the user only needs to indicate what task implementation base class is to be used. Then, when the general scheduling scheduled task scans the configuration information whose configuration type is to create a scheduled task, the other field information in the configuration information except the task implementation class field is used as the parameters of the task implementation base class, that is, the corresponding task method is executed according to the other field information, and then a task implementation class corresponding to the configuration information is generated. In this way, the administrator does not need to repeatedly write the same code, which is also conducive to improving the efficiency of project development.

[0108] In order to better understand the technical solution of the present invention, the present invention also provides a timing task control device, such as Figure 2 As shown, it includes the following modules:

[0109] The time acquisition module 110 is used to obtain the current system time;

[0110] A management table query module 120, for querying a configuration management table for recording configuration information of scheduled tasks to obtain a query result when the current system time satisfies a preset time execution strategy, wherein the query result includes current configuration information;

[0111] A judgment module 130, configured to judge whether the configuration management table contains new configuration information according to the query result;

[0112] The execution module 140 is used to obtain new configuration information when the configuration management table contains new configuration information, and execute the new configuration information.

[0113] Specifically, when the current system time satisfies the preset time execution strategy corresponding to the preset general scheduling timed task, the task content corresponding to the general scheduling timed task is executed, that is, the configuration management table is queried, and the configuration management table is pre-configured in the database by the administrator, which records the configuration information corresponding to all scheduled tasks in the project. After querying the configuration management table, it is determined whether the configuration management table contains new configuration information based on the query result currently queried. It should be noted that the new configuration information may refer to the configuration information newly added to the configuration management table for creating a new scheduled task, or it may be the configuration information of the scheduled task already recorded in the configuration management table, but the information on some fields in the configuration information has been modified by the administrator after the last query of the configuration management table.

[0114] More specifically, in this embodiment, the configuration information of all scheduled tasks is configured in the configuration management table stored in the database. Therefore, when new configuration information needs to be added to the configuration management table, or the configuration information of an existing scheduled task in the configuration management table needs to be modified, it is necessary to obtain the modification permission for modifying the data in the database in advance.

[0115] Since the configuration information of scheduled tasks, including the time execution strategy corresponding to the scheduled tasks, is saved in the database, when the configuration information of the scheduled tasks is modified, there is no need to restart the server to make the modified configuration file take effect as in the past. Instead, the modified configuration information can take effect in real time, which can greatly reduce the difficulty of managing scheduled tasks; and the control operations of scheduled tasks can take effect in real time without the need to frequently restart the server, which is conducive to improving the development efficiency of the project.

[0116] The timing task control device provided by the present invention also implements adding configuration information to the configuration management table through the following embodiments, including the following modules:

[0117] A creation instruction receiving module 210 is used to receive a user's scheduled task creation instruction;

[0118] The configuration information acquisition module 220 is used to acquire the configuration information associated with the scheduled task creation instruction;

[0119] The configuration information filling module 230 is used to fill the configuration information into the configuration management table according to the preset information filling rule.

[0120] In this embodiment, a configuration interface can be provided for the user to receive the scheduled task creation instruction issued by the user, and to receive the configuration information for creating the scheduled task input by the user through the configuration interface. It can be understood that the association between the scheduled task creation instruction and the configuration information means that the configuration information is included in the scheduled task creation instruction, and it can also mean that the configuration information is not included in the instruction, but is transmitted to the server through another data packet. It should be noted that the user is the above-mentioned administrator.

[0121] After obtaining the configuration information input by the user, the field identifiers corresponding to all the information contained in the configuration information are determined, and then the information on each field is filled into the configuration management table at the same position as its field identifier according to the field identifier.

[0122] The timing task control device provided by the present invention also implements modification of configuration information in the configuration management table through the following embodiments, including the following modules:

[0123] The modification instruction receiving module 310 is used to receive a scheduled task modification instruction from a user, wherein the scheduled task modification instruction is associated with the configuration modification information input by the user and the identifier of the task to be modified;

[0124] The configuration information modification module 320 is used to modify the configuration information corresponding to the task identifier to be modified in the configuration management table according to the configuration modification information.

[0125] In one embodiment, the scheduled task modification instruction is used to modify the configuration information of the existing scheduled task in the configuration management table. Accordingly, the configuration modification information includes the field identifier to be modified selected by the user, and the new field information corresponding to the field identifier. Afterwards, the server modifies the field information corresponding to the field identifier to be modified in the configuration management table to the new field information.

[0126] In another embodiment, the scheduled task modification instruction is used to delete an existing scheduled task in the configuration management table. Accordingly, the configuration modification information includes a field identifier to be modified that the user selects to modify, and new field information corresponding to the field identifier, wherein the field identifier to be modified refers to the task status field in this embodiment, and the new field information refers to a preset threshold indicating adding a task, or a preset threshold indicating canceling a task.

[0127] In one embodiment, since the user only needs to modify the task status field in the configuration information of the scheduled task to delete the scheduled task, the user does not need to enter the field identifier to be modified and the new field information corresponding to the field identifier. The user only needs to issue a scheduled task deletion instruction, which is associated with the task identifier of the scheduled task that the user wants to delete.

[0128] When the server receives a scheduled task deletion instruction issued by the user, it obtains the task identification information associated with the scheduled task deletion instruction, then determines the configuration information corresponding to the task identification information from the configuration management table, and modifies the value of the task status field in the configuration information to a preset threshold indicating task cancellation.

[0129] In one embodiment, the determination module 130 includes:

[0130] The historical information acquisition submodule 131 is used to obtain the historical configuration information obtained by querying the configuration management table last time;

[0131] A configuration information comparison submodule 132, for comparing the current configuration information contained in the query result with the historical configuration information;

[0132] A first judgment submodule 133, configured to determine that the configuration management table does not contain new configuration information when the current configuration information is consistent with the historical configuration information;

[0133] The second judgment submodule 134 is used to determine whether the configuration management table contains new configuration information when the current configuration information is inconsistent with the historical configuration information, and use the current configuration information as the new configuration information.

[0134] Accordingly, it also includes:

[0135] The current information acquisition module 410 is used to acquire the current configuration information in the query result;

[0136] The configuration information storage module 420 is used to store the current configuration information in a preset database according to a preset storage format.

[0137] In one embodiment, the configuration information comparison submodule 132 is further used to:

[0138] Comparing the task identification information in the current configuration information with the task identification information in the historical configuration information;

[0139] If the comparison is inconsistent, determining that the configuration type corresponding to the current configuration information is to create a scheduled task;

[0140] If the comparison is consistent, then comparing the task status information in the current configuration information with the task status information in the historical configuration information;

[0141] If the comparison is inconsistent, it is determined that the configuration type corresponding to the current configuration information is to delete the scheduled task.

[0142] In one embodiment, the execution module 140 includes:

[0143] The path information extraction submodule 141 is used to extract the task implementation class path information from the new configuration information when the configuration type corresponding to the new configuration information is to create a scheduled task;

[0144] An implementation class acquisition submodule 142, used for acquiring a task implementation base class according to the task implementation class path information;

[0145] The task creation submodule 143 is used to use the reflection mechanism to take the new configuration information as the parameter of the scheduled task implementation base class to obtain the scheduled task class, and create a new scheduled task according to the scheduled task class.

[0146] It should be noted that the scheduled task control device provided in the embodiment of the present invention can realize the functions realized by the above-mentioned scheduled task control method embodiment. The specific implementation of the functions refers to the description in the above-mentioned scheduled task control method, which will not be repeated here.

[0147] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and the program implements the above-mentioned timed task control method when executed by the processor. Wherein, the storage medium includes but is not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the storage medium includes any medium that stores or transmits information in a readable form by a device (for example, a computer). It can be a read-only memory, a disk or an optical disk, etc.

[0148] An embodiment of the present invention further provides a computer device, the computer device comprising:

[0149] one or more processors 510;

[0150] A storage device 520, for storing one or more programs 500,

[0151] When the one or more programs 500 are executed by the one or more processors 510, the one or more processors 510 implement the above-mentioned scheduled task control method.

[0152] like Figure 3 The structure diagram of the computer device of the present invention is shown, which includes a processor 510, a storage device 520, an input unit 530, a display unit 540 and other devices. Those skilled in the art can understand that Figure 3 The structural devices shown do not constitute a limitation on all computer devices, and may include more or fewer components than shown, or combine certain components. The storage device 520 can be used to store the application 500 and various functional modules, and the processor 510 runs the application 500 stored in the storage device 520, thereby executing various functional applications and data processing of the device. The storage device 520 can be an internal memory or an external memory, or include both internal and external memories. The internal memory may include a read-only memory, a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory, or a random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a U disk, a magnetic tape, etc. The storage device disclosed in the present invention includes but is not limited to these types of storage devices. The storage device 520 disclosed in the present invention is only used as an example and not as a limitation.

[0153] The input unit 530 is used to receive the input of the signal, and to receive the relevant request such as the selection of the voice file input by the user. The input unit 530 may include a touch panel and other input devices. The touch panel can collect the touch operation of the user on or near it (such as the operation of the user using any suitable object or accessory such as a finger, a stylus, etc. on the touch panel or near the touch panel), and drive the corresponding connection device according to the pre-set program; other input devices may include but are not limited to one or more of a physical keyboard, a function key (such as a play control key, a switch key, etc.), a trackball, a mouse, a joystick, etc. The display unit 540 can be used to display the information input by the user or the information provided to the user and various menus of the computer device. The display unit 540 can be in the form of a liquid crystal display, an organic light emitting diode, etc. The processor 510 is the control center of the computer device, which uses various interfaces and lines to connect various parts of the entire computer, and executes various functions and processes data by running or executing software programs and / or modules stored in the storage device 520, and calling data stored in the storage device.

[0154] In one embodiment, a computer device includes one or more processors 510, one or more storage devices 520, and one or more applications 500, wherein the one or more applications 500 are stored in the storage device 520 and are configured to be executed by the one or more processors 510, and the one or more applications 500 are configured to execute the timed task control method described in the above embodiment.

[0155] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0156] It should be understood that the functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0157] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A timed task control method, It is characterized in that include: Get the current system time; When the current system time satisfies the preset time execution strategy, querying a configuration management table for recording configuration information of scheduled tasks to obtain a query result, wherein the query result includes the current configuration information; Judging whether the configuration management table contains new configuration information according to the query result, including: obtaining historical configuration information obtained by querying the configuration management table last time; comparing the current configuration information contained in the query result with the historical configuration information; if the current configuration information is consistent with the historical configuration information, determining that the configuration management table does not contain new configuration information; if the current configuration information is inconsistent with the historical configuration information, determining that the configuration management table contains new configuration information, and using the current configuration information as new configuration information; If included, the new configuration information is obtained and the new configuration information is executed, including: if the configuration type corresponding to the new configuration information is to create a scheduled task, the task implementation class path information is extracted from the new configuration information; the task implementation base class is obtained according to the task implementation class path information; the new configuration information is used as a parameter of the scheduled task implementation base class by using the reflection mechanism to obtain the scheduled task class, and a new scheduled task is created according to the scheduled task class; Among them, comparing the current configuration information contained in the query result with the historical configuration information also includes: comparing the task identification information in the current configuration information with the task identification information in the historical configuration information; if the comparison is inconsistent, determining that the configuration type corresponding to the current configuration information is to create a scheduled task; if the comparison is consistent, comparing the task status information in the current configuration information with the task status information in the historical configuration information; if the comparison is inconsistent, determining that the configuration type corresponding to the current configuration information is to delete the scheduled task.

2. The timed task control method according to claim 1, It is characterized in that Also includes: Receive the user's scheduled task creation instructions; Obtaining configuration information associated with the scheduled task creation instruction; Fill the configuration information into the configuration management table according to preset information filling rules.

3. The timed task control method according to claim 1, It is characterized in that Also includes: Receive a scheduled task modification instruction from a user, where the scheduled task modification instruction is associated with the configuration modification information input by the user and an identifier of the task to be modified; Determine the target configuration information corresponding to the task identifier to be modified; The target configuration information is modified according to the configuration modification information.

4. The timed task control method according to claim 1, It is characterized in that Also includes: Obtain all current configuration information in the query result; The current configuration information is stored in a preset database according to a preset storage format.

5. A timed task control device, It is characterized in that include: Time acquisition module, used to obtain the current system time; A management table query module, used to query a configuration management table for recording configuration information of scheduled tasks to obtain a query result when the current system time meets the preset time execution strategy, wherein the query result includes the current configuration information; A judgment module, used to judge whether the configuration management table contains new configuration information according to the query result, including: obtaining the historical configuration information obtained by querying the configuration management table last time; comparing the current configuration information contained in the query result with the historical configuration information; if the current configuration information is consistent with the historical configuration information, it is determined that the configuration management table does not contain new configuration information; if the current configuration information is inconsistent with the historical configuration information, it is determined that the configuration management table contains new configuration information, and the current configuration information is used as the new configuration information; An execution module is used to obtain the new configuration information when the configuration management table contains new configuration information, and execute the new configuration information, including: if the configuration type corresponding to the new configuration information is to create a scheduled task, extracting the task implementation class path information from the new configuration information; obtaining the task implementation base class according to the task implementation class path information; using the reflection mechanism to use the new configuration information as a parameter of the scheduled task implementation base class to obtain the scheduled task class, and creating a new scheduled task according to the scheduled task class; Among them, when the judgment module is used to compare the current configuration information contained in the query result with the historical configuration information, it is also used to: compare the task identification information in the current configuration information with the task identification information in the historical configuration information; if the comparison is inconsistent, determine that the configuration type corresponding to the current configuration information is to create a scheduled task; if the comparison is consistent, compare the task status information in the current configuration information with the task status information in the historical configuration information; if the comparison is inconsistent, determine that the configuration type corresponding to the current configuration information is to delete the scheduled task.

6. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the timing task control method as described in any one of claims 1 to 4 is implemented.

7. A computer device, It is characterized in that The computer device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the timed task control method as described in any one of claims 1 to 4.