CN112612592A - Configurable timed task processing method, device, equipment and storage medium - Google Patents

Configurable timed task processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112612592A
CN112612592A CN202011595979.3A CN202011595979A CN112612592A CN 112612592 A CN112612592 A CN 112612592A CN 202011595979 A CN202011595979 A CN 202011595979A CN 112612592 A CN112612592 A CN 112612592A
Authority
CN
China
Prior art keywords
timing task
configuration information
server application
task
timing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011595979.3A
Other languages
Chinese (zh)
Inventor
冼嘉诚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202011595979.3A priority Critical patent/CN112612592A/en
Publication of CN112612592A publication Critical patent/CN112612592A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the technical field of data processing, and provides a configurable timed task processing method, device, equipment and medium. The method comprises the following steps: reading a server application which is currently accessed to a timing task configuration center, acquiring a timing task of the server application and configuration information of the timing task, and forming a configurable list according to the timing task and initial configuration information; and modifying the initial configuration information corresponding to the timing task in the configurable list according to a preset rule to obtain target configuration information, and configuring the modified target configuration information into the server application after analyzing the modified target configuration information so as to enable the server application to execute corresponding timing task processing. The invention also relates to the technical field of bank insurance research and development management, can quickly and efficiently complete the instant dynamic processing of the timing task in the server application, and can avoid the problems of complex operation and complex processing process that the server application needs to be redeployed and even restarted when the server application independently modifies the timing task.

Description

Configurable timed task processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a configurable timed task processing method, apparatus, device, and medium.
Background
The use of timed tasks is ubiquitous in application development based on timed triggered activities, services. In the configuration file, different time expressions are configured in different environments, and the timing task is triggered in a timing mode based on the expressions, wherein the process is fixed. If the triggering method is wrong, the service is unavailable, and if the timing task triggers an endless loop task, even a large amount of memory is occupied, and the service is unavailable.
In the prior art, when a problem occurs in the timing task triggering process, a server application needs to modify a timing task independently, redeploy an application, and even restart the server application. In addition, if an undetected error occurs, operations such as revising the timing task, redeploying the application, restarting and the like are required, the whole process is complex, and the operation is very complicated.
Disclosure of Invention
Based on the above problems, an object of the present invention is to provide a configurable timed task processing method, apparatus, device and medium. The invention can quickly and efficiently complete the instant dynamic processing of the timing task in the server application, so as to avoid the problems of complex operation and complex processing process, such as redeployment of the application, even restarting of the server application and the like when the server application independently modifies the timing task.
The above purpose is realized by the following technical scheme:
according to an aspect of the present invention, the present invention provides a configurable timed task processing method, including:
reading a server application which is currently accessed to a timing task configuration center, and acquiring a timing task of the server application and initial configuration information of the timing task;
forming a configurable list according to the timing task and the initial configuration information of the timing task;
modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information;
and analyzing the modified target configuration information and configuring the target configuration information into the corresponding server application so that the server application executes corresponding timing task processing according to the target configuration information.
Optionally, before the step of reading the server application currently accessed to the timing task configuration center, the method further includes:
accessing a server application to a timing task configuration center;
configuring Redis;
configuring an error reporting amount threshold of the timing task;
and configuring the contact corresponding to the server application according to a contact configuration request sent by the server application.
Optionally, after the step of forming a configurable list according to the timing task and the initial configuration information of the timing task, the method further includes:
configuring the execution authority of the timing task so that the server application in the execution authority executes the timing task.
Optionally, the configurable timed task processing method further includes:
counting error logs in the timing task processing process through server application, and uploading and counting the error logs to Redis;
acquiring the current error reporting amount of the timing task at preset time intervals from the Redis;
comparing the current error reporting amount with the error reporting amount threshold;
if the current error reporting amount is larger than the error reporting amount threshold value, closing the timing task; stopping the triggering thread of the timing task; and simultaneously notifying the server of the corresponding contact by the mail.
Optionally, after the step of forming a configurable list according to the timing task and the initial configuration information of the timing task, the method further includes:
reading the server application which is currently accessed to the timing task configuration center at intervals of preset time;
judging whether the currently read timing task applied by the server is a newly added timing task or not according to the existing timing task and the initial configuration information in the configurable list;
and if so, updating the configurable list according to the server application, the timing task and the configuration information of the timing task.
Optionally, the step of modifying the initial configuration information of the timing task in the configurable list according to a preset rule includes:
modifying the activity trigger time of the timing task in the initial configuration information of the timing task in the configurable list according to a preset activity trigger time modification rule;
modifying the timing expression of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing expression modification rule;
modifying the execution state of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing task running state modification rule;
and modifying the existing state of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing task deleting rule.
Optionally, the step of executing, by the server application, the corresponding timing task processing according to the target configuration information includes:
monitoring target configuration information modified by the timing task through a monitoring thread configured in the server application in advance;
if the modified target configuration information is monitored, the server application executes corresponding timing task processing;
wherein the executing the corresponding timing task processing comprises: executing the timing task corresponding to the timing task expression and the activity trigger time in the target configuration information, executing the starting or closing running state of the timing task, and executing the operation of deleting the timing task.
According to another aspect of the present invention, there is provided a configurable timed task processing device, the processing device comprising:
the reading unit is used for reading the server application which is currently accessed to the timing task configuration center, and acquiring the timing task of the server application and the initial configuration information of the timing task;
a configurable list generating unit, configured to form a configurable list according to the timing task and initial configuration information of the timing task;
the modification unit is used for modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information;
and the execution unit is used for analyzing the modified target configuration information and configuring the analyzed target configuration information into the corresponding server application so as to enable the server application to execute corresponding timing task processing according to the target configuration information.
Optionally, the configurable timed task processing device further includes: and the error reporting early warning unit is used for judging whether the current error reporting amount is larger than an error reporting amount threshold value or not, and if so, closing the timing task.
Optionally, the error-reporting early-warning unit is further configured to stop a triggering thread of the timing task, and notify the server application of a corresponding contact through an email.
According to still another aspect of the present invention, there is provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the configurable timed task processing method.
According to still another aspect of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the configurable timed task processing method.
Has the advantages that: the invention discloses a configurable timed task processing method, a configurable timed task processing device, configurable timed task processing equipment and a configurable timed task processing medium, and relates to the technical field of data processing. The invention forms a configurable list by reading one or more server applications accessed to a timing task configuration center and pulling a timing task in the server applications and configuration information corresponding to the timing task, modifies the configuration information of the timing task in the configurable list, for example, the trigger time of the timing task is modified, or the running state of the timing task, such as the starting and closing of the timing task, is modified, the timing task is closed, or the timing task is deleted, etc., and the modified configuration information is analyzed and configured into the server application in real time, the server application can immediately execute the corresponding timing task processing according to the modified preparation information, for example, executing the timing task corresponding to the modified timing expression, executing the operations of turning on and off the timing task, therefore, the instant processing of the timing task of the dynamic control server application is rapidly and efficiently completed. The invention also relates to the technical field of research and development management, and can be applied to the research and development process of the production risk technology of banks.
The server application can immediately modify the execution of the effective timing task according to the modified configuration information, the whole process only takes effect on a certain modified timing task without influencing other logics of the server application, the operation of the processing process is very simple, the timing task can be configured once in the timing task configuration center, the application does not need to be deployed in the server for many times, and the complicated operations such as restarting the application server are not needed.
In the optional embodiment of the invention, the timing task log is uploaded to the configured redis in real time, the error reporting log quantity in the timing task log, namely the error reporting quantity, is compared with the pre-configured error reporting quantity threshold, then an alarm is given, namely, the usability of the whole system can be stabilized by increasing the error reporting log alarm function, when the error reporting quantity of the timing task exceeds the configured threshold, the timing task is automatically closed, the corresponding thread is automatically stopped, and related personnel are simultaneously notified, so that the problem that the timing task thread occupies too much memory to cause the system to be unavailable is prevented, and the problem is prevented from being expanded.
Drawings
Other objects and results of the present invention will become more apparent and more readily appreciated as the same becomes better understood by reference to the following description taken in conjunction with the accompanying drawings. In the drawings:
FIG. 1 is a flow diagram illustrating a configurable timed task processing method according to an embodiment of the present invention;
FIG. 2 is a logic diagram of a configurable timed task processing method according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating an error warning process in a configurable timed task processing method according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating a configurable list update in a configurable timed task processing method according to an embodiment of the present invention;
FIG. 5 is a block diagram of a configurable timed task processing device in accordance with one embodiment of the present invention;
fig. 6 is a schematic structural diagram of the electronic device of the present invention.
Detailed Description
The technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiment of the present invention:
FIG. 1 schematically illustrates a flow chart of a configurable timed task processing method according to an exemplary embodiment of the present invention. As shown in fig. 1, a configurable timed task processing method provided by the present invention includes:
step S100, reading a server application which is currently accessed to a timing task configuration center, and acquiring a timing task of the server application and initial configuration information of the timing task. Wherein, reading the server application through the timing task configuration center, and reading the content may include: server application names, such as APP1, APP2, APPn, timing tasks in the server application, such as timing task 1, timing task 2, timing task 3, configuration information corresponding to the timing tasks, and the like, such as configuration parameter information such as trigger time.
And step S200, forming a configurable list according to the read timing task and the initial configuration information of the timing task. The configurable list is a configurable list formed by pulling all timing tasks in all server applications.
And step S300, modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information.
Step S400, the modified target configuration information is analyzed and configured to the corresponding server application, so that the server application executes corresponding timing task processing according to the target configuration information. According to the invention, a certain timing task is modified, and then the server application immediately executes a new timing task or executes operations such as starting or closing the timing task according to the received modified configuration information. Specifically, the configuration information may be modified according to the service requirement, for example, when the activity trigger time is changed according to the service requirement, the trigger time is changed through the timed task configuration center, and then the changed timed task is executed through the server application. The modified configuration information may include: the triggering time of the timing task, the timing expression of the timing task, the execution state of the timing task such as the opening and closing of the timing task, the existence state of the timing task such as whether to delete or not, and the like. Accordingly, the executed timed task process may be a business logic process for executing the timed task, and may include, for example: the type of the executed timing task, the trigger time of the timing task, the state of the executed timing task, such as the processing operation of opening and closing, etc.
The above embodiment of the present invention forms a configurable list by reading one or more server applications accessing a timing task configuration center and pulling the server applications and the timing tasks therein and configuration information corresponding to the timing tasks, modifies the configuration information of the timing tasks in the configurable list, for example, the trigger time of the timing task is modified, or the running state of the timing task, such as the starting and the closing of the timing task, is modified, or the timing task is deleted, and real-time analyzing the modified configuration information and configuring the modified configuration information into server application, the server application can immediately execute corresponding timing task processing according to the received modified configuration information, for example, executing the timing task corresponding to the modified timing expression, executing the operations of turning on and off the timing task, therefore, the instant processing of the timing task of the dynamic control server application is rapidly and efficiently completed. In the above embodiment of the present invention, the server application may modify the execution of the effective timing task in real time according to the modified configuration information, the whole process only takes effect on a certain modified timing task, and other logics of the server application are not affected, the operation of the processing process is very simple, and the configuration is performed only once in the timing task configuration center, and there is no need to deploy the application in the server for many times, or even to restart the application server and other tedious operations.
In an optional embodiment, before the steps of reading a server application currently accessed to a timing task configuration center, acquiring a timing task of the server application, and initial configuration information of the timing task, the method further includes: accessing a server application to a timing task configuration center; the configuration Redis is used for storing timing task logs, configurable lists and the like; configuring an error reporting amount threshold of the timing task; and configuring the contact corresponding to the server application according to a contact configuration request sent by the server application. The server application uses a timing task, and one or more server applications accessing to the timing task configuration center may be used. The timed task log may include an error log, a success log, and the like. And performing subsequent error amount comparison and processing immediately by configuring an error amount threshold of the timing task in advance, for example, closing the timing task, sending a mail notification, stopping a triggering thread of the timing task, and the like.
FIG. 2 schematically illustrates a logic diagram of the configurable timed task processing method of the present invention. As shown in fig. 2, in the present invention, n server applications APP may be accessed to a timing task configuration center, each server application may include one or more timing tasks, and the timing tasks in different servers may be the same or different. The timing task configuration center can configure different time expressions according to different environments, and the different environments are connected with different configuration center domain names.
In an optional embodiment, the configurable timed task processing method further includes: and acquiring a current error report log, comparing the error report log quantity, namely the error report quantity with a preset error report quantity threshold value, and immediately performing operations such as alarming of a timing task and the like.
In an optional embodiment, the step of modifying the initial configuration information of the timing task in the configurable list according to a preset rule may specifically include: and modifying the activity trigger time of the timing task in the initial configuration information of the timing task in the configurable list according to a preset activity trigger time modification rule. And modifying the timing expression of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing expression modification rule. And modifying the execution state of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing task running state modification rule. And modifying the existing state of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing task deleting rule.
In an optional embodiment, the step of obtaining the current error report log, comparing the error report log amount, that is, the error report amount, with a pre-configured error report amount threshold, and immediately making an alarm for the timing task may specifically include:
step S410, counting error logs in the timing task processing process through a server application, and uploading and counting the error logs to Redis; and the error log comprises information such as the ID of the current task thread, the task name and the like.
And step S420, acquiring the current error reporting amount of the timing task at preset time intervals in the Redis.
Step S430, comparing the current error reporting amount with the error reporting amount threshold.
Step S440, if the current error reporting amount is larger than the error reporting amount threshold, closing the timing task.
In the above embodiment of the present invention, the preset interval time is set according to an actual situation, and for example, the preset interval time may be once every 30 s. The error reporting amount threshold value can be pre-configured according to the actual situation through the timing task configuration center. According to the embodiment, the timing task can be closed in time according to the comparison result of the current error reporting amount and the error reporting amount threshold, so that the timing task is controlled in real time, and the occurrence of subsequent problems is avoided.
In an optional embodiment, if the current error reporting amount is greater than the error reporting amount threshold, the step of closing the timing task further includes: and sending out the mail to remind the server to apply the corresponding contact configured in advance. Optionally, in the step of sending out the email alert server application preconfigured corresponding contact, the preconfigured corresponding contact may be performed after the step of accessing the server application to the timed task configuration center, and specifically may include the following steps: receiving a contact configuration request sent by a server application; and configuring the corresponding contact of the server application according to the contact configuration request. And configuring the corresponding contact person of the server application, wherein the configuration comprises configuring information such as a mailbox and the like of the corresponding contact person so as to send out a notification through a mail and notify the contact person to perform timely processing operation.
In an optional embodiment, if the current error reporting amount is greater than the error reporting amount threshold, the step of closing the timing task further includes: and stopping the trigger thread of the timing task. To prevent the error from continuing, such as a dead-cycle business thread that cannot be stopped due to an error. Wherein, the thread of a certain timing task can be controlled/stopped by the underlying function of each server application.
Fig. 3 schematically shows a flow chart of error reporting early warning in a configurable timed task processing method according to another embodiment of the present invention, as shown in fig. 3, the step of acquiring a current error reporting log, comparing the error reporting log amount, that is, an error reporting amount, with a pre-configured error reporting amount threshold, and immediately making an alarm for a timed task may specifically include:
step S410, counting error logs in the timing task processing process through a server application, and uploading and counting the error logs to Redis;
step S420, acquiring the current error reporting amount of the timing task at preset time intervals in the Redis;
step S430, comparing the current error reporting quantity with the error reporting quantity threshold;
step S440, if the current error reporting amount is larger than the error reporting amount threshold value, closing the timing task; sending out a mail to remind a server to apply a preset corresponding contact; and stopping the trigger thread of the timing task.
In the above embodiment of the present invention, the timed task log is uploaded to the preconfigured redis in real time, then the error report log in the timed task log is obtained at intervals, and the error report amount is compared with the preconfigured error report amount threshold, and according to the comparison result, corresponding operations are performed, such as closing the timed task, sending a mail alert, closing the trigger thread, and the like. The embodiment of the invention can stabilize the usability of the whole system by adding the error log alarm function, automatically close the timing task when the error reporting quantity of the timing task exceeds the configuration threshold value, and further realize the effect of dynamically and immediately controlling the timing task in the server application. Furthermore, the usability of the whole system can be stabilized by adding a log alarm mode, when the error reporting quantity of the timing task exceeds a configuration threshold value, the timing task can be automatically closed, meanwhile, a mail is sent to remind a contact person, and the corresponding thread is automatically stopped, so that the problem that the timing task thread occupies too much memory to cause the system to be unavailable is prevented, and the problem is prevented from being expanded.
In an optional embodiment, after the step of forming a configurable list according to the timing task and the initial configuration information of the timing task, the method further includes: configuring the execution authority of the timing task so that the server application in the execution authority executes the timing task. Specifically, permission configuration may be performed on a certain timing task of a certain server application on a timing task configuration center page, for example, in order to avoid that the timing task of the server application a is modified by the server application B, permission of each server application/timing task needs to be configured, so as to perform permission management, thereby improving accuracy of subsequent operations.
Illustratively, the configurable timed task processing method further comprises: and configuring a listening thread of the server application. Specifically, the modified configuration information is analyzed and configured to the application service in real time; the configuration modification of the timing task is monitored through the monitoring thread, and when the configuration of a certain timing task is monitored to be modified, the server application can be modified in time to take effect, so that dynamic control is realized, and related processing of the timing task, such as the modification of a timing expression, the opening and closing of the timing task, and the dynamic updating of service opening and closing of the timing task and the like, can be better realized in system regulation.
Illustratively, the step of the server application executing the corresponding timing task processing according to the target configuration information may specifically include: monitoring target configuration information modified by the timing task through a monitoring thread configured in the server application in advance; if the modified target configuration information is monitored, the server application executes corresponding timing task processing; wherein the executing the corresponding timing task processing comprises: executing the timing task corresponding to the timing task expression and the activity trigger time in the target configuration information, executing the starting or closing running state of the timing task, and executing the operation of deleting the timing task.
Fig. 4 schematically shows a flow of updating a configurable list in a configurable timed task processing method according to an embodiment of the present invention. As shown in fig. 4, after the step of reading the currently accessed server application, and forming a configurable list according to the read server application, the timing task, and the configuration information of the timing task, the method further includes:
step S210, reading the currently accessed server application at intervals of preset time, and judging whether the currently read timing task of the server application is a newly added timing task or not according to the existing server application, the timing task and the initial configuration information in the configurable list; the preset interval time is set according to actual conditions, and can be read once every two hours, for example.
Step S220, if yes, updating the configurable list according to the server application, the timing task and the configuration information of the timing task. Specifically, the current existing application, the existing timing task and the task parameter information can be compared in a polling, one-by-one application and one-by-one timing task configuration modification mode, and if new tasks are added, the corresponding information in the configuration list is updated.
According to the embodiment of the invention, the timing tasks covered in the real-time updating configurable list are all timing tasks in the current access server application by reading the currently accessed server application at intervals of the preset time and updating the configurable list in real time, so that the accuracy of the dynamic control of the subsequent timing tasks is ensured.
Fig. 5 schematically shows the structure of a configurable timed task processing device according to an embodiment of the present invention. As shown in fig. 5, the present application provides a configurable timed task processing device, including: reading unit 100, configurable list generation unit 200, modification unit 300, execution unit 400.
The reading unit 100 is configured to read a server application currently accessed to a timing task configuration center, and acquire a timing task of the server application and initial configuration information of the timing task.
The configurable list generating unit 200 is configured to form a configurable list according to the timing task and the initial configuration information of the timing task.
The modifying unit 300 is configured to modify the initial configuration information of the timing task in the configurable list according to a preset rule, so as to obtain target configuration information.
The executing unit 400 is configured to parse the modified target configuration information and configure the parsed target configuration information into the corresponding server application, so that the server application executes corresponding timing task processing according to the target configuration information.
In an optional embodiment, the apparatus further comprises an access unit for accessing one or more server applications to the timed task configuration center.
Illustratively, the access unit may include: the configuration module is used for configuring Redis used for storing a timing task log or a configurable list, configuring an error reporting amount threshold of the timing task, and configuring information such as server application authority.
In an optional embodiment, the reading unit 100 further includes: the updating module is used for reading the server application which is currently accessed to the timing task configuration center at intervals of preset time, and judging whether the timing task of the currently read server application is a newly added timing task or not according to the existing timing task and the initial configuration information in the configurable list; and if so, updating the configurable list according to the server application, the timing task and the configuration information of the timing task.
In an optional embodiment, the apparatus may further include: and the error reporting early warning unit is used for judging whether the current error reporting amount is larger than an error reporting amount threshold value or not, and if so, closing the timing task.
Illustratively, the error warning unit may include: the statistical module is used for counting error logs in the timed task processing process through server application and uploading and counting the error logs to Redis; the error reporting quantity acquiring module is used for acquiring the current error reporting quantity of the timing task at preset time intervals in the Redis; and the judging module is used for comparing the current error reporting amount with the error reporting amount threshold value, and closing the timing task if the current error reporting amount is larger than the error reporting amount threshold value. Illustratively, the determining module is further configured to send out a corresponding contact configured in advance by the email alert server application. Illustratively, the determining module is further configured to stop a triggering thread of the timed task.
The invention discloses a configurable timed task processing device, which is characterized in that a reading unit reads one or more server applications accessed to a timed task configuration center and pulls the server applications and the timed tasks and configuration information corresponding to the timed tasks in the server applications to form a configurable list; modifying configuration information of the timed tasks in the configurable list by a modifying unit and an executing unit, and real-time analyzing the modified configuration information and configuring the modified configuration information into the server application, so that the server application immediately executes corresponding timing task processing according to the received modified configuration information, for example, executing the timing task corresponding to the modified timing expression, executing the operations of turning on and off the timing task, therefore, the real-time processing of the timing task of the dynamic control server application is quickly and efficiently completed, the whole processing process only takes effect on a certain modified timing task, other logics of the server application are not influenced, the processing process is very simple to operate, the timing task can be configured once in the timing task configuration center, the application does not need to be deployed in the server for many times, and the complex operations such as restarting the application server are not needed.
Fig. 6 schematically shows the structure of the electronic device of the present invention. As shown in fig. 6, the electronic apparatus 1 may include: memory 11, processor 10, a bus, and computer programs stored in memory 11 and operable on the processor 10, such as timed task handler 12. The processor 10, when executing the computer program, implements the steps of the configurable timed task processing method of the present invention. For example, reading a server application currently accessed to a timing task configuration center, and acquiring a timing task of the server application and initial configuration information of the timing task; forming a configurable list according to the timing task and the initial configuration information of the timing task; modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information; analyzing the modified target configuration information and configuring the target configuration information into the corresponding server application so that the server application executes corresponding timing task processing according to the target configuration information; or further realizing the steps of obtaining the error report log, comparing the error report log quantity, namely the error report quantity, with a preset error report quantity threshold value, immediately giving an alarm of a timing task and the like.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of the timed task processing program 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device 1, connects various components of the electronic device 1 by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
It will be appreciated by a person skilled in the art that the electronic device 1 with the above-described components does not constitute a limitation of the electronic device 1, and that fewer or more components may be included, or that certain components may be combined, or that different arrangements of components may be provided. For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), or optionally a standard wired interface, or a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The timed task processing program 12 stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 10, may implement steps of a method or may implement functions of units and/or modules, such as: reading a server application which is accessed to a timing task configuration center at present, and acquiring a timing task of the server application and initial configuration information of the timing task; forming a configurable list according to the timing task and the initial configuration information of the timing task; modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information; analyzing the modified target configuration information and configuring the target configuration information into the corresponding server application so that the server application executes corresponding timing task processing according to the target configuration information; or further realizing the steps of obtaining the error report log, comparing the error report log quantity, namely the error report quantity, with a preset error report quantity threshold value, immediately giving an alarm of a timing task and the like.
In the present invention, the integrated module/unit of the electronic device 1 may be stored in a computer readable storage medium if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. The computer readable storage medium may be any tangible medium containing or storing a program or instructions, and stores a computer program that can be executed, and when the computer program is executed by the processor 10, the computer program implements the functions of each step in the configurable timed task processing method or each unit/module in the system through hardware related to the stored program instructions. For example, reading a server application currently accessed to a timing task configuration center, and acquiring a timing task of the server application and initial configuration information of the timing task; forming a configurable list according to the timing task and the initial configuration information of the timing task; modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information; analyzing the modified target configuration information and configuring the target configuration information into the corresponding server application so that the server application executes corresponding timing task processing according to the target configuration information; or further realizing the steps of obtaining the error report log, comparing the error report log quantity, namely the error report quantity, with a preset error report quantity threshold value, immediately giving an alarm of a timing task and the like. The computer-readable medium may include, for example: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and device may be implemented in other ways. The above-described system embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or modules recited in the apparatus claims may also be implemented by one unit or module through software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A configurable timed task processing method, the method comprising:
reading a server application which is currently accessed to a timing task configuration center, and acquiring a timing task of the server application and initial configuration information of the timing task;
forming a configurable list according to the timing task and the initial configuration information of the timing task;
modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information;
and analyzing the modified target configuration information and configuring the target configuration information into the corresponding server application so that the server application executes corresponding timing task processing according to the target configuration information.
2. The configurable timed task processing method according to claim 1, wherein said step of reading the server application currently accessed to the timed task configuration center further comprises:
accessing a server application to a timing task configuration center;
configuring Redis;
configuring an error reporting amount threshold of the timing task;
and configuring the contact corresponding to the server application according to a contact configuration request sent by the server application.
3. The configurable timed task processing method according to claim 2, wherein after the step of forming the configurable list according to the timed task and the initial configuration information of the timed task, further comprising:
and configuring the execution authority of the timing task so that the server application in the execution authority executes the timing task.
4. The configurable timed task processing method according to claim 2, characterized in that it further comprises:
counting error logs in the timing task processing process through server application, and uploading and counting the error logs to Redis;
acquiring the current error reporting amount of the timing task at preset time intervals from the Redis;
comparing the current error reporting amount with the error reporting amount threshold;
if the current error reporting amount is larger than the error reporting amount threshold value, closing the timing task; stopping the triggering thread of the timing task; and simultaneously notifying the server of the corresponding contact by the mail.
5. The configurable timed task processing method according to claim 1, wherein after the step of forming the configurable list according to the timed task and the initial configuration information of the timed task, further comprising:
reading the server application which is currently accessed to the timing task configuration center at intervals of preset time;
judging whether the currently read timing task applied by the server is a newly added timing task or not according to the existing timing task and the initial configuration information in the configurable list;
and if so, updating the configurable list according to the server application, the timing task and the configuration information of the timing task.
6. The method according to claim 2, wherein the step of modifying the initial configuration information of the timing task in the configurable list according to the preset rule comprises:
modifying the activity trigger time of the timing task in the initial configuration information of the timing task in the configurable list according to a preset activity trigger time modification rule;
modifying the timing expression of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing expression modification rule;
modifying the execution state of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing task running state modification rule;
and modifying the existing state of the timing task in the initial configuration information of the timing task in the configurable list according to a preset timing task deleting rule.
7. The configurable timed task processing method according to claim 6, wherein the step of the server application executing the corresponding timed task processing according to the target configuration information includes:
monitoring target configuration information modified by the timing task through a monitoring thread configured in the server application in advance;
if the modified target configuration information is monitored, the server application executes corresponding timing task processing; wherein the executing the corresponding timing task processing comprises: executing the timing task corresponding to the timing task expression and the activity trigger time in the target configuration information, executing the starting or closing running state of the timing task, and executing the operation of deleting the timing task.
8. A configurable timed task processing apparatus, comprising:
the reading unit is used for reading the server application which is currently accessed to the timing task configuration center, and acquiring the timing task of the server application and the initial configuration information of the timing task;
a configurable list generating unit, configured to form a configurable list according to the timing task and initial configuration information of the timing task;
the modification unit is used for modifying the initial configuration information of the timing task in the configurable list according to a preset rule to obtain target configuration information;
and the execution unit is used for analyzing the modified target configuration information and configuring the analyzed target configuration information into the corresponding server application so as to enable the server application to execute corresponding timing task processing according to the target configuration information.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the configurable timed task processing method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements each step in the configurable timed task processing method according to any one of claims 1 to 7.
CN202011595979.3A 2020-12-29 2020-12-29 Configurable timed task processing method, device, equipment and storage medium Pending CN112612592A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011595979.3A CN112612592A (en) 2020-12-29 2020-12-29 Configurable timed task processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011595979.3A CN112612592A (en) 2020-12-29 2020-12-29 Configurable timed task processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112612592A true CN112612592A (en) 2021-04-06

Family

ID=75248852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011595979.3A Pending CN112612592A (en) 2020-12-29 2020-12-29 Configurable timed task processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112612592A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051135A (en) * 2021-04-20 2021-06-29 中国工商银行股份有限公司 Application thread pool monitoring method and thread pool monitoring device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051135A (en) * 2021-04-20 2021-06-29 中国工商银行股份有限公司 Application thread pool monitoring method and thread pool monitoring device
CN113051135B (en) * 2021-04-20 2024-06-07 中国工商银行股份有限公司 Monitoring method of application thread pool and thread pool monitoring device

Similar Documents

Publication Publication Date Title
CN104360878B (en) A kind of method and device of application software deployment
CN107562556B (en) Failure recovery method, recovery device and storage medium
CN111459763A (en) Cross-kubernets cluster monitoring system and method
CN111754123B (en) Data monitoring method, device, computer equipment and storage medium
CN112148700A (en) Log data processing method and device, computer equipment and storage medium
CN111694677A (en) Message queue management method, device, terminal and computer-readable storage medium
CN113051503A (en) Browser page rendering method and device, electronic equipment and storage medium
CN112015815A (en) Data synchronization method, device and computer readable storage medium
CN112612592A (en) Configurable timed task processing method, device, equipment and storage medium
US20170024244A1 (en) Method for monitoring a software program and corresponding electronic device, communication system, computer readable program product and computer readable storage medium
CN117151669A (en) Reminding method and device based on workflow engine execution time and electronic equipment
CN113760491A (en) Task scheduling system, method, equipment and storage medium
CN111209333A (en) Data updating method, device, terminal and storage medium
CN114928603A (en) Client software upgrading method and device, electronic equipment and medium
CN114675976A (en) GPU sharing method, device, equipment and medium based on kubernets
CN110096416B (en) Abnormity warning method and device, computer device and readable storage medium
CN109857720B (en) Database table monitoring method, device, computer device and readable storage medium
CN109460251B (en) Component integration framework management method and device
CN113504969A (en) Container event alarm method and device and electronic equipment
CN114003248B (en) Model management method and device, electronic equipment and storage medium
US12032462B2 (en) Preserving hardware status points in operating system environment for use in preboot diagnostics
US20240134765A1 (en) Preserving hardware status points in operating system environment for use in preboot diagnostics
CN114860600B (en) Visual data embedded point method, device, equipment and storage medium
US20240232034A9 (en) Preserving hardware status points in operating system environment for use in preboot diagnostics
CN118277085A (en) Information acquisition method and computing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination