A method and device for batch service shutdown
By setting batch service control tables and operation and maintenance monitoring web tools, one-click automation and elegant shutdown of batch services is achieved, solving the problem of task impact during batch service downtime, and improving the simplicity and reliability of downtime.
Patent Information
- Application Number
- CN202110783230.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-12
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-07-12
AI Technical Summary
When batch service is stopped, it is difficult to find a suitable downtime point without affecting the current execution of tasks, resulting in a complicated and incomplete downtime process.
By setting the batch service control table, using the operation and maintenance monitoring web tool to issue a stop command, and waiting for the current task to end before the batch service is shut down, realizing one-click automation and elegant shutdown of batch service.
The downtime process of batch service is simplified, making it simpler and faster, reducing operation and maintenance difficulties and technical requirements, and ensuring the integrity of the task.
Smart Images

Figure CN113448711B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer data processing, and in particular to a batch service shutdown method and device. Background Art
[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No statement herein is admitted to be prior art by inclusion in this section.
[0003] Batch services are now widely used in various scenarios, such as scheduled settlement processing and polled file downloads. However, every version update encounters a common problem: how to gracefully stop the batch service to avoid affecting the currently executing batch tasks.
[0004] In the existing business process, the solution for stopping batch services is:
[0005] 1) When maintenance personnel shut down the system, they find a time point when the batch is not executed based on the time point when the batch task is triggered;
[0006] 2) Then check the batch execution status to determine whether there is a batch task currently being executed. If not, stop the batch directly through the script.
[0007] For the above solution, as batch tasks progress, the batch task time points will become more and more dense, and it will become increasingly difficult to find the time to stop the batch. In addition, there is a time difference between checking whether there is a batch task in progress and stopping it, and it cannot be guaranteed that there will be no impact when stopping.
[0008] Therefore, how to provide a new solution that can solve the above technical problems is a technical problem that needs to be solved urgently in this field. Summary of the Invention
[0009] An embodiment of the present invention provides a batch service shutdown method, which implements one-click automated graceful shutdown of batch services, making the shutdown of batch services simpler and faster. The method includes:
[0010] Set up batch service control table;
[0011] Execute batch tasks of batch services according to the batch service control table;
[0012] When batch services need to be shut down, a stop command is issued through the operation and maintenance monitoring web tool;
[0013] The batch service receives a stop instruction and gracefully shuts down the batch service according to the batch service control table. Among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service.
[0014] An embodiment of the present invention further provides a batch service shutdown device, including:
[0015] A batch service control table setting module for setting the batch service control table;
[0016] A batch service execution module for executing the batch tasks of the batch service according to the batch service control table;
[0017] A stop instruction issuing module for issuing a stop instruction through an operation and maintenance monitoring web tool when it is necessary to shut down the batch service;
[0018] A batch service shutdown module for the batch service to receive a stop instruction and gracefully shut down the batch service according to the batch service control table. Among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service.
[0019] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned batch service shutdown method is implemented.
[0020] An embodiment of the present invention further provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program for executing the above-mentioned batch service shutdown method.
[0021] A batch service shutdown method and device provided by an embodiment of the present invention include: first setting a batch service control table; then executing the batch tasks of the batch service according to the batch service control table; then issuing a stop instruction through an operation and maintenance monitoring web tool when it is necessary to shut down the batch service; finally, the batch service receives the stop instruction and gracefully shuts down the batch service according to the batch service control table. Among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service. By setting the batch service control table, controlling the execution of batch tasks, and realizing one-key automatic graceful shutdown of the batch service, the shutdown of the batch service is made simpler and faster. Description of the Drawings
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. In the drawings:
[0023] Figure 1 It is a schematic diagram of a method for batch service shutdown according to an embodiment of the present invention.
[0024] Figure 2 It is a batch task flow chart for executing batch services in a method for batch service shutdown according to an embodiment of the present invention.
[0025] Figure 3 It is a graceful shutdown flow chart for batch services in a method for batch service shutdown according to an embodiment of the present invention.
[0026] Figure 4 It is a schematic diagram of a computer device for running a method for batch service shutdown according to an embodiment of the present invention.
[0027] Figure 5 It is a schematic diagram of a batch service shutdown device according to an embodiment of the present invention. Detailed implementation manners
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and more understandable, the following will further elaborate on the embodiments of the present invention in conjunction with the drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but do not limit the present invention.
[0029] The present invention belongs to the field of network security technology. Figure 1 It is a schematic diagram of a method for batch service shutdown according to an embodiment of the present invention. As Figure 1 shown, the embodiment of the present invention provides a method for batch service shutdown, which realizes one-key automated graceful shutdown of batch services, making the shutdown of batch services simpler and faster. The method includes:
[0030] Step 101: Set up a batch service control table;
[0031] Step 102: Execute the batch tasks of the batch services according to the batch service control table;
[0032] Step 103: When it is necessary to shut down the batch services, send a stop instruction through the operation and maintenance monitoring web tool;
[0033] Step 104: The batch service receives a stop instruction and gracefully shuts down the batch service according to the batch service control table. Among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service.
[0034] A method for shutting down a batch service provided by an embodiment of the present invention includes: first setting a batch service control table; then executing batch tasks of the batch service according to the batch service control table; then when it is necessary to shut down the batch service, sending a stop instruction through an operation and maintenance monitoring web tool; finally, the batch service receives the stop instruction and gracefully shuts down the batch service according to the batch service control table. Among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service. By setting a batch service control table, controlling the execution of batch tasks, and realizing one-key automatic graceful shutdown of the batch service, the shutdown of the batch service is made simpler and faster in the embodiment of the present invention.
[0035] When specifically implementing a method for shutting down a batch service provided by an embodiment of the present invention, in one embodiment, it may include:
[0036] Set the batch service control table;
[0037] Execute batch tasks of the batch service according to the batch service control table;
[0038] When it is necessary to shut down the batch service, send a stop instruction through an operation and maintenance monitoring web tool;
[0039] The batch service receives the stop instruction and gracefully shuts down the batch service according to the batch service control table. Among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service.
[0040] In the embodiment of the present invention, the batch service corresponds to all services of the batch program and contains multiple independent batch tasks, such as batch tasks of file download and file parsing. It is mainly to support adding a batch stop service for one-key shutdown. The operation and maintenance monitoring web tool is used to provide monitoring services for the running state of the batch service and can shut down and start the batch service with one key.
[0041] In the embodiment of the present invention, the batch service corresponds to all services of the batch program and contains multiple independent batch tasks, such as file download, file parsing and other batch tasks. It mainly supports adding a batch stop service for one-key shutdown. The operation and maintenance monitoring web tool is used to provide monitoring services for the running state of the batch service and can shut down and start the batch service with one key.
[0042] When specifically implementing a batch service shutdown method provided by an embodiment of the present invention, in one embodiment, a batch service control table is set, including:
[0043] Set a batch service control table including four data items: batch service program name, execution switch, execution status, and execution time; among them, the execution switch data item includes an open state or a closed state, and the execution status data item includes an executing state or a stopped state.
[0044] In the embodiment, the data items of the batch service control table at least include: batch service program name, execution switch, execution status, and execution time; in the embodiment of the present invention, by setting a batch task execution switch, it is used to control whether the batch tasks in the batch service can be executed; by saving the current execution status of the batch, the running status of the batch tasks in the batch service is monitored; a one-key shutdown function is provided for maintenance personnel in the operation and maintenance monitoring web tool, which is more simple and fast.
[0045] Figure 2 The flowchart of the batch tasks for executing the batch service in a batch service shutdown method according to an embodiment of the present invention is as Figure 2 shown. When specifically implementing a batch service shutdown method provided by an embodiment of the present invention, in one embodiment, according to the batch service control table, the batch tasks of the batch service are executed, including:
[0046] After the batch task is triggered, obtain the execution switch data item from the batch service control table;
[0047] Judge the state of the execution switch. If the execution switch is in the closed state, do not execute the batch tasks of the batch service;
[0048] If the execution switch is in the open state, execute the batch tasks of the batch service according to the batch service program name, and update the execution status to executing;
[0049] When the batch task is executed, update the execution status to the stopped state.
[0050] In the embodiment, when executing the batch service: first, after the batch task is triggered, obtain the execution switch data item from the batch service control table; the state of the execution switch includes the closed state or the open state; judge the state of the execution switch. If the execution switch is in the closed state, do not execute the batch tasks of the batch service, indicating that the batch service cannot run, and feedback to the business system; if the execution switch is in the open state, execute the batch tasks of the batch service according to the batch service program name, and update the execution status to executing; when the batch task is executed, update the execution status to the stopped state.
[0051] In an example of an embodiment of the present invention, the process of executing a batch service includes:
[0052] Obtain a batch service control table, the data items of which include the batch program name, execution switch (on / off), execution status (executing / stopped), execution time, etc.;
[0053] After a batch task is triggered, first determine the execution switch of the batch program. If the switch is off, the batch program cannot be executed; otherwise, execute the corresponding batch program and update the execution status to the executing state;
[0054] After the batch task ends, update the execution status to the stopped state.
[0055] When specifically implementing a method for halting a batch service provided by an embodiment of the present invention, in one embodiment, when it is necessary to halt the batch service, a stop instruction is issued through an operation and maintenance monitoring web tool, including:
[0056] According to business requirements, when it is necessary to halt the batch service, select the corresponding batch service and the batch tasks under the batch service on the page of the operation and maintenance monitoring web tool, and issue a stop instruction.
[0057] After setting the batch service control table, the maintenance personnel update the execution switch of the batch task to off by directly operating the database, and then query the execution status of the batch task. If the execution status is stopped, directly stop the batch through the sh script; otherwise, continue to wait. This way of stopping the process is relatively complex and requires a high level of business skills for technical personnel, and multiple operations are required. To solve this problem, in the embodiment, the operation and maintenance monitoring web tool includes an operation page, on which the corresponding batch service and the batch tasks under the batch service can be selected. When it is necessary to halt the batch service according to business requirements, select the corresponding batch service and the batch tasks under the batch service on the page of the operation and maintenance monitoring web tool, and issue a stop instruction with one key.
[0058] The embodiment of the present invention provides an operation and maintenance monitoring web tool. By issuing a stop instruction with one key by selecting the corresponding batch service and the batch tasks under the batch service on the page, it realizes one-key halting of the batch service, has low requirements for maintenance technical personnel, and can achieve one-key operation.
[0059] Figure 3 The figure shows the flowchart of graceful halting of a batch service for a method of halting a batch service according to an embodiment of the present invention. As Figure 3 shown, when specifically implementing a method for halting a batch service provided by an embodiment of the present invention, in one embodiment, the batch service receives a stop instruction and gracefully halts the batch service according to the batch service control table, including:
[0060] The batch service receives a stop instruction sent by the operation and maintenance monitoring web tool;
[0061] According to the stop instruction, modify the status of the execution switch in the batch service control table to the closed state;
[0062] Query the execution status of the batch tasks in the batch service according to the batch service control table;
[0063] If the execution status of the batch task is the stop state, call the stop script to gracefully shut down the batch service;
[0064] If the execution status of the batch task is the executing state, continue to poll and query until the execution status of the batch task is updated to the stop state.
[0065] In the embodiment, the process of gracefully shutting down the batch service mainly includes:
[0066] First, the batch service receives a stop instruction sent by the operation and maintenance monitoring web tool;
[0067] Then, according to the stop instruction, modify the status of the execution switch in the batch service control table to the closed state to ensure that the batch task will not be executed again;
[0068] Next, query the execution status of the batch tasks in the batch service according to the batch service control table;
[0069] If the execution status of the batch task is the stop state, call the stop script to gracefully shut down the batch service. The main process includes: before the batch service shuts down, no new processing services are added, and after waiting for the currently executing batch task to be processed, then shut down the batch service;
[0070] If the execution status of the batch task is the executing state, continue to poll and query until the execution status of the batch task is updated to the stop state.
[0071] In an example of the embodiment of the present invention, the process of gracefully stopping the batch service includes: receiving a shutdown instruction sent by the operation and maintenance monitoring web tool; modifying the batch task switch in the batch control table to closed to ensure that the batch task will not be executed again; querying the execution status of the batch task, if it is closed, call the stop script to stop the batch service, otherwise continue to poll and query until the execution status is stopped.
[0072] When specifically implementing a batch service shutdown method provided by the embodiment of the present invention, in one embodiment, the method further includes: using the operation and maintenance monitoring web tool to display the current running status of the batch service and the corresponding batch tasks on the page of the operation and maintenance monitoring web tool.
[0073] In the embodiment, the operation and maintenance monitoring web tool also has the function of displaying the current running status of batch services and corresponding batch tasks. Therefore, the operation and maintenance monitoring web tool can be used to display the current running status of batch services and corresponding batch tasks on the page of the operation and maintenance monitoring web tool.
[0074] The operation and maintenance monitoring web tool of the embodiment of the present invention can reduce the operation and maintenance difficulty and provide a simpler and faster operation method for operation and maintenance personnel.
[0075] The present invention controls whether a batch task can be executed by setting a batch service execution switch, monitors the running status of the batch by saving the current execution status of the batch, and provides an emergency stop function for maintenance personnel in the operation and maintenance monitoring web tool, which is simpler and faster.
[0076] The following briefly describes a batch service shutdown method provided by the embodiment of the present invention in combination with a specific scenario:
[0077] Set a batch service control table to save the execution switch and execution status;
[0078] Maintenance personnel can monitor the running status of the batch through the operation and maintenance monitoring web tool. When shutting down, they only need to select the corresponding batch service on the page and then stop it;
[0079] After receiving the stop instruction, the batch service will first update the execution switch of the corresponding batch task to closed, and then wait for the execution status of the batch task to be stopped, and call the stop script provided by the batch service to perform the stop operation.
[0080] The present invention controls whether a batch task can be executed by setting a batch service execution switch, monitors the running status of the batch by saving the current execution status of the batch, and provides an emergency stop function for maintenance personnel in the operation and maintenance monitoring web tool, which is simpler and faster.
[0081] When programming and implementing, it is necessary to code to complete the judgment of the batch task execution switch and the update of the batch task execution status. Here, the method with the least intrusion into the current code needs to be considered. Further, it is necessary to code to provide a set of operation and maintenance monitoring web tools for maintenance personnel. Here, the management of permissions needs to be considered key.
[0082] When the batch service is executing:
[0083] 1) Set a batch service control table, and the data items include batch program name, execution switch (opened / closed), execution status (executing / stopped), execution time, etc.;
[0084] 2) After the batch task is triggered, first check the execution switch of the batch program. If the switch is off, the batch program cannot be executed; otherwise, execute the corresponding batch program and update the execution status to the in-execution status.
[0085] 3) After the batch task ends, update the execution status to the stopped status.
[0086] During the downtime of the batch service:
[0087] 1) Receive the downtime instruction from the operation and maintenance monitoring web tool.
[0088] 2) Modify the batch task switch in the batch control table to off to ensure that the batch task will not be executed again.
[0089] 3) Query the execution status of the batch task. If it is off, call the stop script to stop the batch service; otherwise, continue to poll and query until the execution status is stopped.
[0090] The operation and maintenance monitoring web tool mainly includes the following functions:
[0091] 1) Display the current running status of various batches according to the query control table.
[0092] 2) Issue a stop instruction to provide one-key downtime and startup functions.
[0093] The operation and maintenance monitoring web tool of the embodiment of the present invention reduces the operation and maintenance difficulty and provides a simpler and faster operation method for operation and maintenance personnel.
[0094] Set the batch service control table to record the execution switch and execution status, which provides a prerequisite for graceful shutdown; the present invention controls whether a batch task can be executed by setting the batch service execution switch; monitors the running status of the batch by saving the current execution status of the batch; provides a one-key downtime function for maintenance personnel in the operation and maintenance monitoring web tool, which is simpler and faster.
[0095] Figure 4 The schematic diagram of the computer device for running a batch service downtime method implemented by the present invention is as Figure 4 shown. The embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned batch service downtime method is implemented.
[0096] The embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for implementing the above-mentioned batch service downtime method.
[0097] An embodiment of the present invention also provides a batch service shutdown device, as described in the following embodiments. Since the principle of this device to solve problems is similar to that of a batch service shutdown method, the implementation of this device can refer to the implementation of a batch service shutdown method, and the repeated parts will not be described again.
[0098] Figure 5 It is a schematic diagram of a batch service shutdown device according to an embodiment of the present invention. As Figure 5 shown, an embodiment of the present invention also provides a batch service shutdown device, which may specifically include:
[0099] A batch service control table setting module 501, which is used to set a batch service control table;
[0100] A batch service execution module 502, which is used to execute batch tasks of batch services according to the batch service control table;
[0101] A stop instruction issuing module 503, which is used to issue a stop instruction through an operation and maintenance monitoring web tool when it is necessary to shut down the batch service;
[0102] A batch service shutdown module 504, which is used to receive the stop instruction for the batch service and gracefully shut down the batch service according to the batch service control table; wherein, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch task is processed and then shut down the batch service.
[0103] When specifically implementing a batch service shutdown device provided by an embodiment of the present invention, in one embodiment, the batch service control table setting module is specifically used for:
[0104] Setting a batch service control table including four data items: batch service program name, execution switch, execution status, and execution time; wherein, the execution switch data item includes an open state or a closed state, and the execution status data item includes an executing state or a stopped state.
[0105] When specifically implementing a batch service shutdown device provided by an embodiment of the present invention, in one embodiment, the batch service execution module is specifically used for:
[0106] After the batch task is triggered, obtaining the execution switch data item from the batch service control table;
[0107] Judging the state of the execution switch. If the execution switch is in the closed state, the batch task of the batch service is not executed;
[0108] If the execution switch is in the open state, execute the batch task of the batch service according to the batch service program name and update the execution status to executing;
[0109] After the batch task execution ends, update the execution status to the stopped state.
[0110] When specifically implementing a batch service shutdown device provided by an embodiment of the present invention, in one embodiment, the stop instruction issuing module is specifically used for:
[0111] According to business requirements, when it is necessary to shut down the batch service, select the corresponding batch service and the batch tasks under the batch service on the page of the operation and maintenance monitoring web tool, and issue a stop instruction.
[0112] When specifically implementing a batch service shutdown device provided by an embodiment of the present invention, in one embodiment, the batch service shutdown module is specifically used for:
[0113] The batch service receives the stop instruction sent by the operation and maintenance monitoring web tool;
[0114] According to the stop instruction, modify the status of the execution switch in the batch service control table to the closed state;
[0115] Query the execution status of the batch tasks in the batch service according to the batch service control table;
[0116] If the execution status of the batch task is the stopped state, call the stop script to gracefully shut down the batch service;
[0117] If the execution status of the batch task is the executing state, continue to poll and query until the execution status of the batch task is updated to the stopped state.
[0118] When specifically implementing a batch service shutdown device provided by an embodiment of the present invention, in one embodiment, the device further includes a running status display module, which is used to use the operation and maintenance monitoring web tool to display the current running status of the batch service and the corresponding batch tasks on the page of the operation and maintenance monitoring web tool.
[0119] In summary, a batch service shutdown method and device provided by an embodiment of the present invention include: first setting a batch service control table; then, according to the batch service control table, executing the batch tasks of the batch service; then, when it is necessary to shut down the batch service, issuing a stop instruction through the operation and maintenance monitoring web tool; finally, the batch service receives the stop instruction and gracefully shuts down the batch service according to the batch service control table; wherein, gracefully shutting down the batch service includes: before shutting down the batch service, not adding new processing services, and waiting for the currently executing batch tasks to be processed and ended before shutting down the batch service. The embodiment of the present invention controls the execution of batch tasks by setting a batch service control table and realizes one-key automatic graceful shutdown of the batch service, making the shutdown of the batch service simpler and faster.
[0120] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0121] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0122] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, so that the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0124] The specific embodiments described above further elaborate on the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for batch service shutdown, characterized in that, Including: Set a batch service control table; According to the batch service control table, execute the batch tasks of the batch service; When it is necessary to shut down the batch service, send a stop instruction through the operation and maintenance monitoring web tool; The batch service receives the stop instruction and gracefully shuts down the batch service according to the batch service control table; among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service; Among them, setting the batch service control table includes: Set a batch service control table including four data items: batch service program name, execution switch, execution status, and execution time; monitor the running status of batch tasks in the batch service by saving the current execution status of the batch, where the execution switch data item includes an open status or a closed status, and the execution status data item includes an executing status or a stopped status; The batch service receives the stop instruction and gracefully shuts down the batch service according to the batch service control table, including: The batch service receives the stop instruction sent by the operation and maintenance monitoring web tool; According to the stop instruction, modify the status of the execution switch in the batch service control table to the closed state; According to the batch service control table, query the execution status of batch tasks in the batch service; If the execution status of the batch task is the stopped status, call the stop script to gracefully shut down the batch service; If the execution status of the batch task is the executing status, continue to poll and query until the execution status of the batch task is updated to the stopped status.
2. The method according to claim 1, wherein According to the batch service control table, execute the batch tasks of the batch service, including: After the batch task is triggered, obtain the execution switch data item from the batch service control table; Judge the status of the execution switch. If the execution switch is in the closed state, do not execute the batch tasks of the batch service; If the execution switch is in the open state, execute the batch tasks of the batch service according to the batch service program name and update the execution status to executing; When the batch task is executed and completed, update the execution status to the stopped status.
3. The method according to claim 1, characterized in that When it is necessary to shut down the batch service, send a stop instruction through the operation and maintenance monitoring web tool, including: According to the business requirements, when it is necessary to shut down the batch service, select the corresponding batch service and the batch tasks under the batch service on the page of the operation and maintenance monitoring web tool and send a stop instruction.
4. The method according to claim 1, wherein It also includes: Use the operation and maintenance monitoring web tool to display the current running status of the batch service and the corresponding batch tasks on the page of the operation and maintenance monitoring web tool.
5. A batch service shutdown device, characterized in that, Including: Batch service control table setting module, used to set the batch service control table; Batch service execution module, used to execute the batch tasks of the batch service according to the batch service control table; Stop instruction sending module, used to send a stop instruction through the operation and maintenance monitoring web tool when it is necessary to shut down the batch service; Batch service shutdown module, used for the batch service to receive the stop instruction and gracefully shut down the batch service according to the batch service control table; among them, gracefully shutting down the batch service includes: before shutting down the batch service, no new processing services are added, and it is necessary to wait until the currently executing batch tasks are processed and then shut down the batch service; Among them, the batch service control table setting module is specifically used for: Setting a batch service control table including four data items: batch service program name, execution switch, execution status, and execution time; monitoring the running status of batch tasks in the batch service by saving the current execution status of the batch, where the execution switch data item includes an open status or a closed status, and the execution status data item includes an executing status or a stopped status; The batch service shutdown module is specifically used for: The batch service receives a stop instruction sent by the operation and maintenance monitoring web tool; According to the stop instruction, modify the status of the execution switch in the batch service control table to the closed status; According to the batch service control table, query the execution status of batch tasks in the batch service; If the execution status of the batch task is the stopped status, call the stop script to gracefully shut down the batch service; If the execution status of the batch task is the executing status, continue to poll and query until the execution status of the batch task is updated to the stopped status.
6. The device according to claim 5, characterized in that, The batch service execution module is specifically used for: After the batch task is triggered, obtain the execution switch data item from the batch service control table; Judge the status of the execution switch. If the execution switch is in the closed status, do not execute the batch tasks of the batch service; If the execution switch is in the open status, execute the batch tasks of the batch service according to the batch service program name, and update the execution status to executing; When the batch task execution ends, update the execution status to the stopped status.
7. The device according to claim 5, characterized in that, The stop instruction sending module is specifically used for: According to the business requirements, when it is necessary to shut down the batch service, select the corresponding batch service and the batch tasks under the batch service on the page of the operation and maintenance monitoring web tool, and send a stop instruction.
8. The device according to claim 5, characterized in that, It further includes a running status display module for using the operation and maintenance monitoring web tool to display the current running status of the batch service and the corresponding batch tasks on the page of the operation and maintenance monitoring web tool.
9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Ansible-based banking service operation and maintenance system and method
CN110276594A
Server control method and device, computing equipment and medium
CN112860328A
Batch server maintenance method
JP2016018350A