A batch file monitoring method, device and computer equipment

By generating alarms by concatenating absolute paths and log information in configuration files, the issues of flexibility and accuracy in batch file transfer monitoring are resolved, thus improving operational efficiency.

CN119788660BActive Publication Date: 2025-11-25CHINA CITIC BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411762754.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-11-25
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

Existing batch file transfer monitoring methods are unable to quickly respond to temporary file transfer needs, and are difficult to accurately locate anomalies and assess their impact in multi-system interactions.

Method used

By using low-privilege, flexibly adjustable parameters in the configuration file, the absolute path of the batch file is concatenated, and alarm information is generated by combining log files and custom information, and then fed back to the operation and maintenance personnel.

Benefits of technology

It enables flexible and convenient monitoring of batch file transmission status, timely generation of alarm information, and improves operation and maintenance efficiency and fault location capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788660B_ABST
    Figure CN119788660B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides a batch file monitoring method, device and computer equipment, comprising executing a check script to read a configuration file of a preset batch file; according to a file storage path, a date type and a file name in the configuration file, an absolute path of a to-be-monitored batch file is spliced; it is judged whether the to-be-monitored batch file exists under the absolute path; if yes, the to-be-monitored batch file is monitored silently; if not, custom information in a log file and the configuration file of the to-be-monitored batch file is acquired, alarm information is generated according to the log file and the custom information and is fed back to an operation and maintenance personnel. The method realizes flexible and convenient monitoring of the transmission state of the batch file through the configuration file; and when the batch file is not transmitted successfully, alarm information can be immediately generated according to the custom information and the log file, so as to facilitate the operation and maintenance personnel to locate the fault, thereby improving the operation and maintenance efficiency of the fault.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of file transfer monitoring technology, and in particular to a batch file monitoring method, apparatus, and computer device. Background Technology

[0002] Batch data exchange between systems refers to the timed transfer and sharing of data between two or more systems under specific conditions. These systems exchange data using specific technologies and protocols to achieve information sharing and business process collaboration. This data exchange typically occurs in the background, without manual intervention, and is executed according to a predetermined schedule or triggering conditions. Its purpose is to ensure data consistency between different systems. For example, data synchronization between a bank's core system and multiple systems such as risk management systems, user information systems, and transaction systems.

[0003] Common methods for batch data exchange between systems include: ① Inter-system database batch operations: Performing batch data insertion and update operations between databases using SQL scripts. ② Extract, transform, and load (ETL): Extracting data from the source system, cleaning and transforming the data, and then loading it into the target database or data warehouse. ③ Inter-system batch file transfer: Automatically and in batches transferring files using specific technologies and protocols. Batch file transfer offers significant advantages in efficiency, accuracy, ease of operation, applicability, and security, and is widely used in large institutions such as finance, banking, and enterprises. Therefore, monitoring the execution status of batch file transfers has become an important part of the work of operations and maintenance personnel.

[0004] However, existing methods for monitoring the execution status of batch file transfers still have some shortcomings. For example, batch file transfers are usually carried out according to a preset plan, and existing monitoring methods struggle to respond quickly and accurately to increases or decreases in temporary file transfer demands. Furthermore, since batch file transfers often involve interactions between multiple systems, once the monitoring system issues an alarm, it is difficult to quickly and accurately locate the anomaly and assess its potential impact.

[0005] To address these issues, embodiments of this specification aim to provide a batch file monitoring method, apparatus, and computer device. Summary of the Invention

[0006] In view of the above-mentioned problems in the prior art, the purpose of the embodiments of this specification is to provide a batch file monitoring method, apparatus and computer equipment to solve the problems of insufficient information feedback or restricted permissions in the monitoring of batch files in the prior art.

[0007] To solve the above-mentioned technical problems, the specific technical solutions of the embodiments in this specification are as follows:

[0008] Firstly, embodiments of this specification provide a batch file monitoring method, including:

[0009] Execute the check script to read the configuration file of the preset batch file;

[0010] Based on the file storage path, date type, and file name in the configuration file, the absolute path of the batch file to be monitored is obtained by concatenating the information.

[0011] Determine whether the batch file to be monitored exists under the absolute path;

[0012] If it exists, then the batch file to be monitored will be silently monitored;

[0013] If it does not exist, the log file of the batch file to be monitored and the custom information in the configuration file are obtained, and an alarm message is generated based on the log file and the custom information and the alarm message is fed back to the operation and maintenance personnel.

[0014] Further, the step of concatenating the absolute path of the batch file to be monitored based on the file storage path, date type, and file name in the configuration file includes:

[0015] The generation date of the batch file to be monitored is determined based on the date type.

[0016] The absolute path is obtained by concatenating the generation date, the file storage path, and the file name.

[0017] Furthermore, based on the date type, the generation date of the batch file to be monitored is determined, including:

[0018] If the date type is the first type, then the date in the file storage path is determined as the generation date;

[0019] If the date type is the second type, then the date in the file storage path after incrementing by one is determined as the generation date;

[0020] If the date type is a third type, then the date in the filename is determined as the generation date;

[0021] If the date type is the fourth type, then the date in the filename after incrementing by one will be determined as the generation date.

[0022] Specifically, before determining whether the batch file to be monitored exists under the absolute path, the method further includes:

[0023] Obtain the file monitoring time from the configuration file;

[0024] Based on the file monitoring time, determine whether the monitoring time for the batch file to be monitored has arrived.

[0025] Further, alarm information is generated based on the log file and the custom information, including:

[0026] The alarm cause information is obtained by looking up the alarm field in the log file in a pre-configured alarm information lookup table.

[0027] The alarm information is generated based on the importance level of the batch file to be monitored and the alarm reason information in the custom information.

[0028] Furthermore, alarm information is generated based on the log file and the custom information, including:

[0029] The alarm fields in the log file are input into the pre-trained alarm analysis model to obtain alarm cause information;

[0030] The alarm information is generated based on the importance level of the batch file to be monitored and the alarm reason information in the custom information.

[0031] Specifically, the alarm analysis model is trained through the following steps:

[0032] Obtain the historical batch files that experienced execution errors, as well as the log files of those historical batch files;

[0033] Input the key fields from the log file into the initial alarm analysis model to obtain the alarm cause information of the historical batch file;

[0034] The alarm cause information is compared with the actual anomaly cause information of the historical batch files to obtain the comparison result;

[0035] The initial alarm analysis model is iteratively trained based on the comparison results until the comparison results are less than a preset error rate threshold or the predetermined number of iterations is reached, thus obtaining the trained alarm analysis model.

[0036] Preferably, the method further includes:

[0037] Obtain the latest arrival time and processing time from the custom information;

[0038] The latest arrival time and the processing time are fed back to the operations and maintenance personnel.

[0039] Specifically, the step of feeding back the alarm information to the operation and maintenance personnel includes:

[0040] The alarm information is fed back to the operations and maintenance personnel through one or more of the following methods: log files, system console, and email notifications.

[0041] Secondly, embodiments of this specification provide a batch file monitoring device, comprising:

[0042] The execution module is used to execute the check script to read the configuration file of the preset batch file;

[0043] The splicing module is used to splice the absolute path of the batch file to be monitored based on the file storage path, date type and file name in the configuration file;

[0044] The judgment module is used to determine whether the batch file to be monitored exists under the absolute path;

[0045] The monitoring module is used to silently monitor the batch file to be monitored if it exists.

[0046] The alarm module is used to obtain the log file of the batch file to be monitored and the custom information in the configuration file if the log file does not exist, generate alarm information based on the log file and the custom information, and feed the alarm information back to the operation and maintenance personnel.

[0047] Thirdly, embodiments of this specification provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method provided by the above-described technical solution.

[0048] Fourthly, embodiments of this specification provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided by the above-described technical solution.

[0049] Fifthly, embodiments of this specification provide a computer program product, including at least one instruction or at least one program segment, wherein the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the method provided by the above-described technical solution.

[0050] By adopting the above technical solution, the batch file monitoring method, apparatus, and computer device provided in the embodiments of this specification can achieve flexible and convenient monitoring of the transmission status of batch files by setting a configuration file with low privileges and flexible adjustment of configuration parameters. Furthermore, when a batch file fails to be transmitted, alarm information can be generated immediately based on custom information and log files and fed back to the operation and maintenance personnel, so that the operation and maintenance personnel can locate the fault based on the alarm information and improve the efficiency of fault operation and maintenance.

[0051] To make the above and other objects, features and advantages of the embodiments of this specification more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This specification illustrates a step diagram of a batch file monitoring method provided in an embodiment.

[0054] Figure 2 This diagram illustrates the steps involved in generating alarm information based on log files and custom information.

[0055] Figure 3 This diagram illustrates another step in generating alarm information based on log files and custom information.

[0056] Figure 4 The diagram illustrates the steps of the alarm analysis model training method.

[0057] Figure 5 This specification shows a schematic diagram of the structure of a batch file monitoring device provided in an embodiment;

[0058] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of this specification is shown.

[0059] Explanation of symbols in the attached drawings:

[0060] 51. Execution module;

[0061] 52. Splicing module;

[0062] 53. Judgment module;

[0063] 54. Monitoring module;

[0064] 55. Alarm module;

[0065] 602. Computer equipment;

[0066] 604, Processor;

[0067] 606. Memory;

[0068] 608. Drive mechanism;

[0069] 610. Input / output module;

[0070] 612. Input devices;

[0071] 614. Output devices;

[0072] 616. Presentation equipment;

[0073] 618. Graphical User Interface;

[0074] 620. Network interface;

[0075] 622. Communication link;

[0076] 624. Communication bus. Detailed Implementation

[0077] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0078] It should be noted that the terms "first," "second," etc., used in this specification, claims, and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0079] Existing file transfer monitoring methods are limited to verifying whether files are successfully and on time transmitted, but cannot provide information about the reasons for transmission failures and their potential impact, thus resulting in insufficient information feedback. Furthermore, in actual operation and maintenance environments, system permissions for maintenance personnel are strictly controlled, requiring high-level privileges to perform update or delete operations, thereby restricting maintenance operations. To address the above problems, embodiments of this specification provide a batch file monitoring method, apparatus, and computer device. Figure 1 This diagram illustrates the steps of a batch file monitoring method provided in the embodiments of this specification. This specification provides the operational steps of the method described in the embodiments or flowcharts, but based on conventional or non-inventive methods, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or device products, the methods shown in the embodiments or drawings can be executed sequentially or in parallel. Specifically, as shown in the diagrams... Figure 1 As shown, the method may include:

[0080] S110: Execute the check script to read the configuration file of the preset batch file.

[0081] The inspection script can be executed automatically at set time intervals, and during the automatic execution process, it accesses and reads the configuration parameters of each batch file to be monitored in the configuration file.

[0082] The configuration file can be named file_generate.cfg. For each batch file to be monitored, the configuration file records the following five configuration parameters:

[0083] File monitoring time (MonitorTime): This parameter is used to set the time point for monitoring batch files, which follows the 24-hour format "HH:MM:SS".

[0084] FileName: This parameter specifies the name of the batch file to be monitored. Since batch file names are often complex, containing elements such as system identifiers, function identifiers, character encodings, and file dates, in some feasible implementations, the filename can be a portion of the actual batch file name that guarantees its uniqueness; that is, the filename can be different from the actual batch file name.

[0085] FilePath: This parameter specifies the storage path for the batch file. If the batch file is stored in a folder containing date information, this file path does not need to include date information. For example, if a batch file is stored in a folder named / filepath / 20240514, this parameter can be simply configured as / filepath.

[0086] DateType: This parameter reflects the generation date of the batch file, as indicated in the filename and file storage path. It includes four types, each with a different meaning. See below for details.

[0087] CustomMessage: This parameter is used to customize the description information of the batch file. It can include the importance level of the batch file, the latest arrival time, the processing time required, etc., to provide more detailed guidance and explanations for the batch file to the operation and maintenance personnel, and help them better understand the status of the batch file.

[0088] In the embodiments described in this specification, the configuration file has low permissions, allowing maintenance personnel to edit and update the configuration parameters of the batch file in the configuration file without going through complex multi-level approvals, making the operation more flexible and convenient.

[0089] S120: Based on the file storage path, date type, and file name in the configuration file, the absolute path of the batch file to be monitored is obtained by concatenating them.

[0090] S130: Determine whether the batch file to be monitored exists under the absolute path.

[0091] S140: If it exists, then perform silent monitoring on the batch file to be monitored.

[0092] If the batch file exists in the absolute path (i.e., there is a file in the absolute path whose name corresponds to the file name in the configuration file), it means that the batch file has been successfully processed, and then only silent monitoring of the batch file is required.

[0093] S150: If it does not exist, obtain the log file of the batch file to be monitored and the custom information in the configuration file, generate alarm information based on the log file and the custom information, and feed the alarm information back to the operation and maintenance personnel.

[0094] This specification provides a batch file monitoring method that, by setting a low-privilege configuration file with flexibly adjustable configuration parameters, enables flexible and convenient monitoring of the transmission status of batch files. Furthermore, when a batch file fails to be transmitted, it can immediately generate alarm information based on custom information and log files and provide feedback to maintenance personnel, so that maintenance personnel can locate the fault based on the alarm information and improve the efficiency of fault maintenance.

[0095] In this embodiment of the specification, step S120, which involves concatenating the file storage path, date type, and file name in the configuration file to obtain the absolute path of the batch file to be monitored, further includes:

[0096] Based on the date type, determine the generation date of the batch file to be monitored. This further includes:

[0097] If the date type is the first type (denoted as T), then the date in the file storage path is determined as the generation date; for example, if the file storage path is / filepath / 20240514, then the generation date of the batch file can be obtained from it as 20240514.

[0098] If the date type is type two (denoted as Y), then the date in the file storage path after subtracting one is determined as the generation date; for example, if the file storage path is / filepath / 20240513, then adding one to the date in it will give the generation date of the batch file as 20240514. That is, the date in the file storage path is the day before the actual generation date.

[0099] In other words, if the date is of type T or type Y, the required generation date is obtained from the file storage path.

[0100] If the date type is a third type (denoted as N), then the date in the filename is determined as the generation date; for example, if the filename is / filepath / filename_20240514.xml, then the generation date of the batch file can be obtained from it as 20240514.

[0101] If the date type is type four (denoted as NY), then the date in the filename after incrementing by one is determined as the generation date. For example, if the filename is / filepath / filename_20240513.xml, then incrementing the date in it will give the batch file's generation date as 20240514. That is, the date in the filename is the day before the actual generation date.

[0102] Therefore, if the date is of type 3 (N) or type 4 (NY), the required generation date is obtained from the filename.

[0103] In other words, in the embodiments of this specification, the generation date of the batch file can be included in the file storage path or in the file name, thereby being compatible with different information statistics rules arising from different sources of batch files. When determining the generation date of the batch file, whether it is obtained from the file storage path or the file name is characterized by the date type.

[0104] Then, the absolute path is obtained by concatenating the generation date, the file storage path, and the file name.

[0105] For example, the concatenated absolute path can be $FilePath / 20240514 / $FileName. Since the storage path or filename of batch files typically changes dynamically with the date, in this embodiment, the absolute path of the batch file is obtained by concatenating the storage path, filename, and date type from the configuration file. This ensures that the batch file can be accurately located regardless of whether it is stored in a fixed folder whose name changes with the date or in a dynamically generated folder based on the date.

[0106] Furthermore, in this embodiment of the specification, before step S130: determining whether the batch file to be monitored exists under the absolute path, the method further includes:

[0107] Obtain the file monitoring time from the configuration file;

[0108] Based on the file monitoring time, determine whether the monitoring time for the batch file to be monitored has arrived.

[0109] The inspection script executes automatically at predetermined time intervals and reads the configuration parameters of each batch file to be monitored from the configuration file. If a batch file has not yet reached its monitoring time, it is not monitored. Conversely, if the batch file reaches its monitoring time, a step is taken to determine whether the batch file exists at its absolute path. In this embodiment, the inspection script is configured with the configuration information of multiple batch files to be monitored, and it monitors each batch file according to its own monitoring time. This eliminates the need to customize inspection scripts for each batch file, reducing maintenance code costs and improving maintenance economy.

[0110] Furthermore, such as Figure 2As shown, in some feasible embodiments, step S150, generating alarm information based on the log file and the custom information, may further include:

[0111] S210: Based on the alarm field in the log file, look up the pre-configured alarm information lookup table to obtain the alarm cause information.

[0112] For example, the alarm fields in the log file could be "Permission denied," "chdir failed," "No such file," "No such directory," etc. From a pre-configured alarm information lookup table, the system can determine the cause of the alarm for "Permission denied" as a permission issue encountered during batch file operation, meaning the current user may not have sufficient permissions to read or write a batch file; the cause of "chdir failed" is that the system cannot switch to the specified directory, possibly because the directory does not exist or the user lacks access permissions; the cause of "No such file" is that the system cannot find the specified file; and the cause of "No such directory" is that the system cannot find the specified directory. Therefore, through the pre-configured alarm information lookup table, when these alarm fields appear in the log file during batch file processing, the system automatically looks up the corresponding alarm information in the lookup table and displays the corresponding alarm cause in Chinese, allowing maintenance personnel to quickly understand the meaning of the alarm cause and take effective action.

[0113] S220: Generate the alarm information based on the importance level of the batch file to be monitored and the alarm reason information in the custom information.

[0114] Furthermore, in the embodiments of this specification, technicians can pre-set the importance level of the batch file to be monitored in the configuration parameter of the configuration file of the batch file to be monitored (for example, the importance level of the batch file can be determined according to factors such as the source of the batch file and time limit requirements). Thus, when the processing of the batch file fails, an alarm message is generated to prompt the relevant operation and maintenance personnel by combining the importance level of the batch file and its alarm reason information.

[0115] In some feasible implementations, the importance level can include three levels: low, medium, and high (of course, the number of importance levels is only an example, and can be set according to actual application needs). When generating alarm messages for batch files with different importance levels that have failed during execution, the alarm messages for batch files with high importance can be more prominent than those for batch files with low importance. For example, the alarm message for a high-importance batch file can be in bold red; the alarm message for a medium-importance batch file can be in bold orange; and the alarm message for a low-importance batch file can be in bold yellow. Thus, maintenance personnel can intuitively understand the importance level of the batch file based on the color of the alarm message, prioritize the high-importance batch files, and quickly determine the cause of the alarm based on the alarm message, thereby rapidly resolving the fault.

[0116] In addition, the higher the importance level of a batch file, the more channels and the higher the frequency of feedback when its alarm information is sent to the corresponding maintenance personnel, which is conducive to the maintenance efficiency of batch file failures with high importance.

[0117] like Figure 3 As shown, in some other feasible embodiments, step S150, generating alarm information based on the log file and the custom information, further includes:

[0118] S310: Input the alarm fields in the log file into the pre-trained alarm analysis model to obtain alarm cause information.

[0119] It should be noted that the pre-trained alarm analysis model refers to the alarm analysis model that can obtain relatively accurate alarm cause information output based on the input alarm fields. However, with the development of banking business, the types of batch files may increase, and new processing failures may occur. Therefore, the alarm analysis model can be continuously iterated and updated to adapt to business development.

[0120] S320: Generate the alarm information based on the importance level of the batch file to be monitored and the alarm reason information in the custom information.

[0121] The method for generating alarm information here is the same as or similar to the method for generating alarm information in step S220 above, and the effect is the same, so it will not be described again here.

[0122] Furthermore, such as Figure 4As shown in the embodiments of this specification, the alarm analysis model in step S310 can be trained through the following steps:

[0123] S410: Obtain the historical batch files of execution exceptions and the log files of the historical batch files.

[0124] In other words, historical batch files that exhibited abnormalities during execution are used as training data for this alarm analysis model.

[0125] S420: Input the key fields in the log file into the initial alarm analysis model to obtain the alarm cause information of the historical batch file.

[0126] S430: Compare the alarm cause information with the actual abnormal cause information of the historical batch file to obtain the comparison result.

[0127] The true cause of anomalies in historical batch files can be determined manually by operations and maintenance personnel, and based on this, operations and maintenance methods can be formulated to effectively resolve the cause of the anomalies in those historical batch files.

[0128] S440: The initial alarm analysis model is iteratively trained based on the comparison results until the comparison results are less than a preset error rate threshold or the predetermined number of iterations is reached, thereby obtaining the pre-trained alarm analysis model.

[0129] By establishing and training alarm analysis models, the causes of anomalies during batch file execution can be quickly located. Furthermore, when the amount of training data is large, it can automatically learn more complex patterns and correlations between data, thus exhibiting good generalization ability and enabling accurate prediction of alarm information for alarm fields in batch files that have not been seen before.

[0130] Furthermore, in the embodiments of this specification, the method further includes:

[0131] Obtain the latest arrival time and processing time from the custom information;

[0132] The latest arrival time and the processing time are fed back to the operations and maintenance personnel.

[0133] The latest arrival time refers to the latest time the batch file will arrive at its corresponding absolute path after execution, while the processing time refers to the approximate time required for the batch file to complete execution. In other words, the custom information configuration parameter in the configuration file can also include the latest arrival time and processing time pre-recorded by technical personnel. This pre-recorded information can serve as notes for the batch file. Therefore, when the batch file malfunctions, the latest arrival time and processing time, along with the alarm reason information, can be fed back to the operations and maintenance personnel. This allows the operations and maintenance personnel to understand the importance level of the batch file, the cause of the failure, and some time-limited information about the batch file, facilitating the development of a maintenance plan.

[0134] Furthermore, in the embodiments of this specification, step S150, which involves feeding back the alarm information to the operation and maintenance personnel, includes:

[0135] The alarm information is fed back to the operations and maintenance personnel through one or more of the following methods: log files, system console, and email notifications.

[0136] By combining centralized feedback methods, it is possible to ensure that if one feedback method fails to promptly alert maintenance personnel, other feedback methods can be used to remedy the situation. This ensures timely transmission of alarm information, improves fault resolution efficiency, and reduces potential system risks.

[0137] It should be noted that, in order to ensure the effectiveness of the entire monitoring system, the selection and setting of alarm information feedback methods can be determined according to actual operation and maintenance needs and workflows.

[0138] Based on the batch file monitoring method described above, this specification also provides a batch file monitoring device. The device may include a system (including a distributed system), software (application), module, component, server, client, etc., using the method described in this specification, combined with necessary hardware implementation. Based on the same innovative concept, the devices in one or more embodiments provided in this specification are as described in the following embodiments. Since the implementation schemes and methods for solving the problem are similar, the implementation of specific devices in this specification can refer to the implementation of the aforementioned method, and repeated details will not be repeated. As used below, the terms "unit" or "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0139] like Figure 5 As shown in the embodiments of this specification, a batch file monitoring device includes:

[0140] Execution module 51 is used to execute the inspection script to read the configuration file of the preset batch file;

[0141] The splicing module 52 is used to splice the absolute path of the batch file to be monitored based on the file storage path, date type and file name in the configuration file;

[0142] The judgment module 53 is used to determine whether the batch file to be monitored exists under the absolute path;

[0143] The monitoring module 54 is used to silently monitor the batch file to be monitored if it exists.

[0144] The alarm module 55 is used to obtain the log file of the batch file to be monitored and the custom information in the configuration file if the log file does not exist, generate alarm information based on the log file and the custom information, and feed the alarm information back to the operation and maintenance personnel.

[0145] The beneficial effects obtained by the apparatus provided in the embodiments of this specification are consistent with the beneficial effects obtained by the methods described above, and will not be repeated here.

[0146] like Figure 6 The diagram illustrates a computer device provided in an embodiment of this specification. The batch file monitoring device in this specification can be the computer device in this embodiment, executing the methods described above. The computer device 602 may include one or more processors 604, such as one or more central processing units (CPUs), each of which can implement one or more hardware threads. The computer device 602 may also include any memory 606 for storing information of any kind, such as code, settings, data, etc. Non-limitingly, for example, memory 606 may include any type of RAM, any type of ROM, flash memory, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 602. In one case, when processor 604 executes associated instructions stored in any memory or combination of memories, the computer device 602 can perform any operation of the associated instructions. The computer device 602 also includes one or more drive mechanisms 608 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0147] Computer device 602 may also include an input / output module 610 (I / O) for receiving various inputs (via input device 612) and providing various outputs (via output device 614). A specific output mechanism may include a presentation device 616 and an associated graphical user interface (GUI) 618. In other embodiments, the input / output module 610 (I / O), input device 612, and output device 614 may be omitted, and the device may function solely as a computer device within a network. Computer device 602 may also include one or more network interfaces 620 for exchanging data with other devices via one or more communication links 622. One or more communication buses 624 couple the components described above together.

[0148] Communication link 622 can be implemented in any way, such as via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, or any combination thereof. Communication link 622 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.

[0149] Corresponding to, for example Figures 1 to 4 In addition to the method shown, embodiments of this specification also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the above-described method.

[0150] This specification also provides computer-readable instructions, wherein when a processor executes the instructions, the program therein causes the processor to perform the following... Figures 1 to 4 The method shown.

[0151] This specification also provides a computer program product, including at least one instruction or at least one program segment, wherein the at least one instruction or the at least one program segment is loaded and executed by a processor to achieve the following: Figures 1 to 4 The method shown.

[0152] It should be understood that in the various embodiments of this specification, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this specification.

[0153] It should also be understood that, in the embodiments of this specification, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this specification generally indicates that the preceding and following related objects have an "or" relationship.

[0154] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.

[0155] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0156] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or units, or they may be electrical, mechanical, or other forms of connection.

[0157] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments described in this specification, depending on actual needs.

[0158] Furthermore, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0159] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0160] This specification uses specific embodiments to illustrate the principles and implementation methods of this specification. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this specification. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this specification. Therefore, the content of this specification should not be construed as a limitation of this specification.

Claims

1. A batch file monitoring method, characterized in that, include: Execute the check script to read the configuration file of the preset batch file; Based on the file storage path, date type, and file name in the configuration file, the absolute path of the batch file to be monitored is obtained by concatenating the information. Determine whether the batch file to be monitored exists under the absolute path; If it exists, then the batch file to be monitored will be silently monitored; If it does not exist, the log file of the batch file to be monitored and the custom information in the configuration file are obtained, and an alarm message is generated based on the log file and the custom information and the alarm message is fed back to the operation and maintenance personnel.

2. The method according to claim 1, characterized in that, The step of concatenating the absolute path of the batch file to be monitored based on the file storage path, date type, and file name in the configuration file further includes: The generation date of the batch file to be monitored is determined based on the date type. The absolute path is obtained by concatenating the generation date, the file storage path, and the file name.

3. The method according to claim 2, characterized in that, Determining the generation date of the batch file to be monitored based on the date type further includes: If the date type is the first type, then the date in the file storage path is determined as the generation date; If the date type is the second type, then the date in the file storage path after incrementing by one is determined as the generation date; If the date type is a third type, then the date in the filename is determined as the generation date; If the date type is the fourth type, then the date in the filename after incrementing by one will be determined as the generation date.

4. The method according to claim 1, characterized in that, Before determining whether the batch file to be monitored exists under the absolute path, the method further includes: Obtain the file monitoring time from the configuration file; Based on the file monitoring time, determine whether the monitoring time for the batch file to be monitored has arrived.

5. The method according to claim 1, characterized in that, The alarm information is generated based on the log file and the custom information, and further includes: The alarm cause information is obtained by looking up the alarm field in the log file in a pre-configured alarm information lookup table. The alarm information is generated based on the importance level of the batch file to be monitored and the alarm reason information in the custom information.

6. The method according to claim 1, characterized in that, The alarm information is generated based on the log file and the custom information, and further includes: The alarm fields in the log file are input into the pre-trained alarm analysis model to obtain alarm cause information; The alarm information is generated based on the importance level of the batch file to be monitored and the alarm reason information in the custom information.

7. The method according to claim 6, characterized in that, The alarm analysis model is trained through the following steps: Obtain the historical batch files that experienced execution errors, as well as the log files of those historical batch files; Input the key fields from the log file into the initial alarm analysis model to obtain the alarm cause information of the historical batch file; The alarm cause information is compared with the actual anomaly cause information of the historical batch files to obtain the comparison result; The initial alarm analysis model is iteratively trained based on the comparison results until the comparison results are less than a preset error rate threshold or the predetermined number of iterations is reached, thus obtaining the trained alarm analysis model.

8. The method according to claim 1, characterized in that, The method further includes: Obtain the latest arrival time and processing time from the custom information; The latest arrival time and the processing time are fed back to the operations and maintenance personnel.

9. The method according to claim 1, characterized in that, The step of feeding back the alarm information to the operation and maintenance personnel includes: The alarm information is fed back to the operations and maintenance personnel through one or more of the following methods: log files, system console, and email notifications.

10. A batch file monitoring device, characterized in that, include: The execution module is used to execute the check script to read the configuration file of the preset batch file; The splicing module is used to splice the absolute path of the batch file to be monitored based on the file storage path, date type and file name in the configuration file; The judgment module is used to determine whether the batch file to be monitored exists under the absolute path; The monitoring module is used to silently monitor the batch file to be monitored if it exists. The alarm module is used to obtain the log file of the batch file to be monitored and the custom information in the configuration file if the log file does not exist, generate alarm information based on the log file and the custom information, and feed the alarm information back to the operation and maintenance personnel.

11. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 9.

13. A computer program product, characterized in that, It includes at least one instruction or at least one program segment, said at least one instruction or said at least one program segment being loaded and executed by a processor to implement the method as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Rapid predictive analysis of very large data sets using the distributed computational graph

    CN108605010A

  • Alarm information processing method and device, electronic equipment and storage medium

    CN119011364A