Batch processing file monitoring method and device and computer equipment
By setting flexible configuration files and generating alarm information in the batch file monitoring system, the problems of insufficient information feedback and limited permissions for batch file transfer status monitoring in the prior art are solved, and flexible monitoring and fault location of batch file transfer status are realized.
Patent Information
- Application Number
- CN202411762754.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-03
AI Technical Summary
In the prior art, when monitoring the execution status of batch file transfers, it is difficult to quickly respond to the increase or decrease of temporary file transfer requirements, and when interacting between multiple systems, it is difficult to quickly and accurately locate abnormalities and evaluate their impact.
By setting low-permissions and flexible adjustment configuration files, executing a check script to read the configuration files of batch files, splicing out the absolute path of the file to be monitored, judging its existence, and generating alarm information based on the log files and custom information to feed back to the operation and maintenance personnel.
It realizes flexible and convenient monitoring of batch file transfer status. When the file is not transferred successfully, alarm information can be generated immediately to help operation and maintenance personnel quickly locate faults and improve operation and maintenance efficiency.
Smart Images

Figure CN119788660A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of file transfer monitoring technology, and in particular to a batch file monitoring method, apparatus, and computer equipment. Background Art
[0002] Batch data interaction between systems refers to the data transmission and sharing between two or more systems at a fixed time or under specific conditions. They exchange data through specific technologies and protocols to achieve information sharing and business process collaboration. This kind of data interaction is usually carried out in the background, without manual intervention, and is executed according to a certain time plan or trigger conditions, in order to ensure the consistency of data 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 ways of batch data interaction between systems include: ① Inter-system database batch operations: by writing SQL scripts, batch data insertion, update and other operations are performed between databases. ② Data extraction, transformation and loading (ETL): extract data from the source system, clean and transform the data, and then load it into the target database or data warehouse. ③ Inter-system batch file transfer: automatically and batch transfer files through specific technical means and protocols. Among them, batch file transfer has significant advantages in efficiency, accuracy, ease of operation, applicability and security. This batch data interaction method is widely used in large institutions such as finance, banks, and enterprises. Therefore, monitoring the execution status of batch file transfer has become an important part of the work of operation and maintenance personnel.
[0004] However, existing methods for monitoring the execution status of batch file transfers still have some defects. For example, batch file transfers are usually performed according to a preset plan. When faced with the increase or decrease of temporary file transfer needs, existing monitoring methods are difficult to respond quickly and accurately. In addition, 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 to assess the impact that the anomaly may cause.
[0005] In order to solve these problems, the embodiments of this specification are intended to provide a batch file monitoring method, apparatus and computer equipment. Summary of the invention
[0006] In view of the above 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] In order to solve the above technical problems, the specific technical solutions of the embodiments of this specification are as follows:
[0008] In a first aspect, an embodiment of the present specification provides a batch file monitoring method, comprising:
[0009] Execute the check script to read the configuration file of the preset batch file;
[0010] According to 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 splicing;
[0011] Determine whether the batch file to be monitored exists in the absolute path;
[0012] If it exists, the batch file to be monitored is monitored silently;
[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, alarm information is generated according to the log file and the custom information, and the alarm information is fed back to the operation and maintenance personnel.
[0014] Furthermore, the absolute path of the batch file to be monitored is obtained by concatenating the file storage path, date type and file name in the configuration file, including:
[0015] Determine the generation date of the batch file to be monitored according to the date type;
[0016] The absolute path is obtained by concatenating the generation date, the file storage path and the file name.
[0017] Furthermore, determining the generation date of the batch file to be monitored according to the date type includes:
[0018] If the date type is the first type, determining the date in the file storage path as the generation date;
[0019] If the date type is the second type, the date in the file storage path after being incremented by one is determined as the generation date;
[0020] If the date type is the third type, the date in the file name is determined as the generation date;
[0021] If the date type is the fourth type, the date in the file name after being incremented by one is 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] Obtaining the file monitoring time in the configuration file;
[0024] According to the file monitoring time, it is determined whether the monitoring time for the batch file to be monitored has arrived.
[0025] Further, generating warning information according to the log file and the custom information includes:
[0026] Searching a pre-configured alarm information comparison table according to the alarm field in the log file to obtain alarm cause information;
[0027] The alarm information is generated according to the importance level of the batch file to be monitored and the alarm reason information in the custom information.
[0028] Furthermore, generating warning information according to the log file and the custom information includes:
[0029] Inputting the alarm field in the log file into the pre-trained alarm analysis model to obtain alarm cause information;
[0030] The alarm information is generated according to 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] Obtaining historical batch files with execution exceptions and log files of the historical batch files;
[0033] Inputting the key fields in the log file into the initial alarm analysis model to obtain the alarm cause information of the historical batch file;
[0034] Compare the alarm reason information with the real abnormal reason information of the historical batch processing file to obtain a comparison result;
[0035] The initial alarm analysis model is iteratively trained according to the comparison result until the comparison result is less than a preset error rate threshold or a predetermined number of iterative training times is reached, thereby obtaining the trained alarm analysis model.
[0036] Preferably, the method further comprises:
[0037] Obtain the latest arrival time and processing time in the custom information;
[0038] The latest arrival time and the time required for processing are fed back to the operation and maintenance personnel.
[0039] Specifically, feeding back the alarm information to the operation and maintenance personnel includes:
[0040] The alarm information is fed back to the operation and maintenance personnel through one or a combination of log files, system console, and email notification.
[0041] In a second aspect, an embodiment of the present specification provides a batch file monitoring device, comprising:
[0042] An execution module, used for executing a check script to read a configuration file of a preset batch file;
[0043] A splicing module, used for splicing the absolute path of the batch file to be monitored according to the file storage path, date type and file name in the configuration file;
[0044] A judgment module, used for judging whether the batch file to be monitored exists under the absolute path;
[0045] A monitoring module, used for silently monitoring 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 it does not exist, generate alarm information according to the log file and the custom information, and feed back the alarm information to the operation and maintenance personnel.
[0047] In a third aspect, an embodiment of the present specification provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided by the above technical solution when executing the computer program.
[0048] In a fourth aspect, an embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method provided by the above technical solution is implemented.
[0049] In a fifth aspect, an embodiment of the present specification provides a computer program product, comprising at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method provided by the above technical solution.
[0050] By adopting the above technical scheme, a batch file monitoring method, device and computer equipment provided in the embodiments of this specification realize flexible and convenient monitoring of the transmission status of batch files by setting a configuration file with low permissions and flexible adjustment of configuration parameters; and when the batch file is not transmitted successfully, it can immediately generate alarm information based on custom information and log files and feedback to the operation and maintenance personnel, so that the operation and maintenance personnel can locate the fault according to the alarm information and help improve the operation and maintenance efficiency of the fault.
[0051] In order to make the above and other purposes, features and advantages of the embodiments of this specification more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 A schematic diagram of the steps of a batch file monitoring method provided by an embodiment of this specification is shown;
[0054] Figure 2 A schematic diagram showing the steps of generating alarm information based on log files and custom information;
[0055] Figure 3 Another schematic diagram of the steps of generating alarm information according to log files and custom information is shown;
[0056] Figure 4 A schematic diagram showing the steps of the alarm analysis model training method is shown;
[0057] Figure 5 A schematic diagram of the structure of a batch file monitoring device provided in an embodiment of this specification is shown;
[0058] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of this specification is shown.
[0059] Description of the accompanying symbols:
[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, driving 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 DESCRIPTION
[0077] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0078] It should be noted that the terms "first", "second", etc. in this specification and claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0079] Existing file transfer monitoring methods are limited to verifying whether the file is successfully transferred on time, but cannot provide information about the reasons for the transfer failure and the potential impact, thus resulting in insufficient information feedback; and in actual operation and maintenance environments, there is a strict control over the system permissions of operation and maintenance personnel, requiring very high permissions to perform update or deletion operations, thus resulting in the problem of limited operation and maintenance operations. In order to solve the above problems, the embodiments of this specification provide a batch file monitoring method, apparatus, and computer device. Figure 1 This is a step diagram of a batch file monitoring method provided in an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many, and does not represent the only execution order. When the actual system or device product is executed, it can be executed in the order or in parallel according to the method shown in the embodiment or the accompanying drawings. Specifically, 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 automatically executed at set time intervals, and during the automatic execution process, the configuration parameters of each batch file to be monitored in the configuration file are accessed and read.
[0082] The name of the configuration file may be 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 node for monitoring batch files, which follows the 24-hour "HH:MM:SS" format.
[0084] File Name: This parameter is used to specify the name of the batch file to be monitored. Since the name of a batch file is usually complex, for example, it contains elements such as system identification, function identification, character encoding, file date, etc., therefore, in some feasible embodiments, the file name can be a partial field of the actual name of the batch file that can ensure the uniqueness of the batch file, that is, the file name can be different from the actual batch file name.
[0085] File storage path (FilePath): This parameter is used to specify the storage path of the batch file. If the batch file is stored in a folder containing date information, the file storage path does not need to contain 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] Date Type: This parameter is used to reflect the date of batch file generation in the file name and the file storage path. There are four types, and different types have different meanings. See the following description for details.
[0087] Custom Message: This parameter is used to customize the description of the batch file, which can include the importance level of the batch file, the latest arrival time, the processing time, etc. It is used to provide more detailed guidance and instructions about the batch file to the operation and maintenance personnel, helping them to better understand the batch file.
[0088] In the embodiments of this specification, the permissions of the configuration file are relatively low, and the operation and maintenance personnel can edit and update the configuration parameters of the batch file in the configuration file without going through complex multi-level approvals, which makes the operation more flexible and convenient.
[0089] S120: According to 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.
[0090] S130: Determine whether the batch file to be monitored exists under the absolute path.
[0091] S140: If it exists, perform silent monitoring on the batch file to be monitored.
[0092] If the batch file exists under the absolute path (ie, a file whose name corresponds to the file in the configuration file exists under the absolute path), it means that the batch file has been successfully processed, and the batch file only needs to be silently monitored subsequently.
[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 according to the log file and the custom information, and feed back the alarm information to the operation and maintenance personnel.
[0094] A batch file monitoring method provided in an embodiment of the present specification realizes flexible and convenient monitoring of the transmission status of batch files by setting a configuration file with low permissions and flexible adjustment of configuration parameters; and when the batch file is not successfully transmitted, an alarm message can be immediately generated according to the custom information and log file and fed back to the operation and maintenance personnel, so that the operation and maintenance personnel can locate the fault according to the alarm information and help improve the operation and maintenance efficiency of the fault.
[0095] In the embodiment of this specification, step S120: splicing the absolute path of the batch file to be monitored according to the file storage path, date type and file name in the configuration file further includes:
[0096] According to the date type, the generation date of the batch file to be monitored is determined. It further includes:
[0097] If the date type is the first type (denoted as T), the date in the file storage path is determined as the generation date; for example, if the file storage path is / filepath / 20240514, the generation date of the batch file can be obtained as 20240514.
[0098] If the date type is the second type (denoted as Y), the date in the file storage path after the minus-one process is determined as the generation date; for example, if the file storage path is / filepath / 20240513, then the date therein is added with one to obtain 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] That is, when the date type is the first type T or the second type Y, the required generation date is obtained from the file storage path.
[0100] If the date type is the third type (denoted as N), the date in the file name is determined as the generation date; for example, if the file name is / filepath / filename_20240514.xml, the generation date of the batch file can be obtained as 20240514.
[0101] If the date type is the fourth type (denoted as NY), the date in the file name after adding one is determined as the generation date. For example, if the file name is / filepath / filename_20240513.xml, the date in the file name is added one to obtain the generation date of the batch file as 20240514. That is, the date in the file name is the day before the actual generation date.
[0102] Therefore, when the date type is the third type N or the fourth type NY, the required generation date is obtained from the file name.
[0103] That is to say, in the embodiments of the present specification, the generation date of the batch file can be included in the file storage path, or in the file name, so as to be compatible with different information statistics rules caused by different sources of the batch files. When determining the generation date of the batch file, whether to obtain it from the file storage path or from the file name is characterized by the date type.
[0104] Furthermore, the absolute path is obtained by concatenating the generation date, the file storage path and the file name.
[0105] Exemplarily, the absolute path obtained by splicing can be $FilePath / 20240514 / $FileName. Since the storage path or file name of a batch file usually changes dynamically with the date, in the embodiment of this specification, the absolute path of the batch file is spliced by the three configuration parameters of the storage path, file name and date type in the configuration file, ensuring that the batch file can be accurately located regardless of whether the batch file is stored in a fixed folder whose folder name changes with the date, or in a dynamic folder generated according to the date.
[0106] Further, in the embodiment of this specification, before step S130: determining whether the batch file to be monitored exists under the absolute path, the method further includes:
[0107] Obtaining the file monitoring time in the configuration file;
[0108] According to the file monitoring time, it is determined whether the monitoring time for the batch file to be monitored has arrived.
[0109] That is, the check script is automatically executed within a predetermined time interval, and reads the configuration parameters of each batch file to be monitored in the configuration file. If the batch file has not reached the file monitoring time, it will not be monitored temporarily; on the contrary, if the batch file reaches the file monitoring time, a judgment step is performed to determine whether the batch file to be monitored exists under the absolute path. In the embodiment of this specification, the check script is configured with configuration information of multiple batch files to be monitored, and each batch file is monitored according to its own file monitoring time, so there is no need to customize the check script for each batch file, which reduces the cost of operation and maintenance code and improves the economic type of operation and maintenance.
[0110] Furthermore, if Figure 2As shown, in some feasible embodiments, in step S150, generating the alarm information according to the log file and the custom information may further include:
[0111] S210: Searching a pre-configured alarm information comparison table according to the alarm field in the log file to obtain alarm cause information.
[0112] Exemplarily, the alarm fields in the log file may be "Permission denied", "chdirfailed", "No such file", "No such directory", etc. From the pre-configured alarm information comparison table, the alarm reason information corresponding to the alarm field "Permission denied" is that a permission problem is encountered during the batch file operation, that is, the current user may not have sufficient permissions to read or write a batch file; the alarm reason information corresponding to the alarm field "chdir failed" is that the system cannot switch to the specified directory, which may be caused by the non-existence of the directory or the user having no access rights; the alarm reason information corresponding to the alarm field "No such file" is that the system cannot find the specified file; and the alarm reason corresponding to the alarm field "No such directory" is that the system cannot find the specified directory. Thus, through the pre-configured alarm information comparison table, when these alarm fields appear in the log file during the processing of the batch file, the system automatically searches the corresponding alarm information comparison table and prompts the alarm reason obtained by comparison in Chinese, so that the operation and maintenance personnel can quickly understand the meaning of the alarm reason information and make an effective response.
[0113] S220: Generate the alarm information according to the importance level of the batch file to be monitored and the alarm reason information in the custom information.
[0114] Furthermore, in an embodiment of the present specification, a technician can pre-set the importance level of the batch file to be monitored in the customization configuration parameter of the configuration file of the batch file to be monitored (exemplarily, the importance level of the batch file can be determined based on factors such as the source of the batch file and time limit requirements). Thus, when a failure occurs in the processing of the batch file, an alarm message is generated in combination with the importance level of the batch file and its alarm reason information to prompt the corresponding operation and maintenance personnel.
[0115] In some feasible embodiments, the importance level may 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 information for batch files with different importance levels that have execution failures, the alarm information of batch files with high importance levels can be more eye-catching than that of batch files with low importance levels. For example, the alarm information of batch files with high importance levels can have a prompt text in red bold font; the alarm information of batch files with medium importance levels can have a prompt text in orange bold font; and the alarm information of batch files with low importance levels can have a text in yellow bold font. Therefore, the operation and maintenance personnel can intuitively know the importance of the batch file according to the color of the alarm information, and then give priority to the batch files with high importance levels, and know the alarm cause according to the alarm information, and quickly formulate an operation and maintenance method according to the alarm cause to achieve a quick solution to the fault.
[0116] In addition, when the importance level of a batch file is higher, there may be more feedback channels and a higher feedback frequency when its alarm information is fed back to the corresponding operation and maintenance personnel, so as to improve the operation and maintenance efficiency of batch file failures with high importance.
[0117] like Figure 3 As shown, in some other feasible embodiments, in step S150, generating the alarm information according to the log file and the custom information further includes:
[0118] S310: Input the alarm field 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 means that the alarm analysis model can obtain relatively accurate output results of the alarm cause information based on the input alarm field. 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 so that the alarm analysis model can adapt to business development.
[0120] S320: Generate the alarm information according to the importance level of the batch file to be monitored and the alarm reason information in the custom information.
[0121] The method for generating the alarm information here is the same as or similar to the method for generating the alarm information in the above step S220, and the effect obtained is not repeated here.
[0122] Furthermore, if Figure 4As shown, in the embodiment of this specification, the alarm analysis model in step S310 can be trained by the following steps:
[0123] S410: Acquire historical batch processing files with execution exceptions and log files of the historical batch processing files.
[0124] That is to say, the historical batch files in which abnormalities occur are used as training data for the alarm analysis model.
[0125] S420: Inputting key fields in the log file into an initial alarm analysis model to obtain alarm cause information of the historical batch file.
[0126] S430: Compare the alarm reason information with the real abnormal reason information of the historical batch processing file to obtain a comparison result.
[0127] The real abnormal cause of the historical batch file can be manually determined by the operation and maintenance personnel, and the operation and maintenance method is formulated based on this to effectively solve the cause of the abnormality of the historical batch file.
[0128] S440: Iteratively train the initial alarm analysis model according to the comparison result until the comparison result is less than a preset error rate threshold or reaches a predetermined number of iterative training times, thereby obtaining the pre-trained alarm analysis model.
[0129] By establishing and training the alarm analysis model, the cause of anomalies in the batch file execution process can be quickly located; and when the amount of training data is relatively large, more complex patterns and correlations between data can be automatically learned from it. Therefore, it has good generalization ability and can accurately predict alarm information for alarm fields of 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 in the custom information;
[0132] The latest arrival time and the time required for processing are fed back to the operation and maintenance personnel.
[0133] Among them, the latest arrival time refers to the latest time that the batch file arrives at the corresponding absolute path after execution, and the processing time refers to the approximate time required for the batch file to be executed. That is, in the configuration parameter of the custom information of the configuration file, the latest arrival time and processing time pre-recorded by the technician can also be included. These pre-recorded information can be used as comments for the batch file. Therefore, when the batch file fails, the latest arrival time and processing time can be fed back to the operation and maintenance personnel together with the alarm reason information, so that the operation and maintenance personnel can understand some time limit information of the batch file while knowing the importance level of the batch file and the cause of the failure, so as to facilitate the specification of the operation and maintenance plan.
[0134] Further, in the embodiment of this specification, in step S150, feeding back the alarm information to the operation and maintenance personnel includes:
[0135] The alarm information is fed back to the operation and maintenance personnel through one or a combination of log files, system console, and email notification.
[0136] By combining centralized feedback methods, it can be ensured that when one of the feedback methods fails to promptly alert the operation and maintenance personnel, other feedback methods can be used to remedy the situation, thereby ensuring the timely delivery of alarm information feedback, improving fault resolution efficiency, and reducing 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 the feedback method of the alarm information can be determined according to the actual operation and maintenance requirements and workflow.
[0138] Based on the batch file monitoring method described above, the embodiment of 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 the embodiment of this specification and a device combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware of predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0139] like Figure 5 As shown, a batch file monitoring device provided in an embodiment of this specification includes:
[0140] An execution module 51 is used to execute a check script to read a configuration file of a preset batch file;
[0141] A splicing module 52, used for splicing the absolute path of the batch file to be monitored according to the file storage path, date type and file name in the configuration file;
[0142] A judging module 53 is used to judge whether the batch file to be monitored exists under the absolute path;
[0143] A monitoring module 54, for silently monitoring 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 it does not exist, generate alarm information according to the log file and the custom information, and feed back the alarm information to the operation and maintenance personnel.
[0145] The beneficial effects obtained by the device provided in the embodiments of this specification are consistent with the beneficial effects obtained by the above method and will not be repeated here.
[0146] like Figure 6 As shown, a computer device provided by an embodiment of this specification, the batch file monitoring device in this specification can be a computer device in this embodiment, executing the above method of this specification. The computer device 602 may include one or more processors 604, such as one or more central processing units (CPUs), and each processing unit may implement one or more hardware threads. The computer device 602 may also include any memory 606, which is used to store any kind of information such as code, settings, data, etc. Non-restrictive, for example, the memory 606 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, 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 the processor 604 executes an associated instruction stored in any memory or a combination of memories, the computer device 602 can perform any operation of the associated instruction. The computer device 602 also includes one or more drive mechanisms 608 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0147] The computer device 602 may also include an input / output module 610 (I / O) for receiving various inputs (via input devices 612) and for providing various outputs (via output devices 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 not be included, and the computer device 602 may be used as a computer device in a network. The 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] The communication link 622 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The 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 Figures 1 to 4 In addition to the method shown, an embodiment of the specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0150] The embodiment of the present specification also provides a computer-readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 4 The method shown.
[0151] The embodiments of the present specification also provide a computer program product, including at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the following Figures 1 to 4 The method shown.
[0152] It should be understood that in the various embodiments of this specification, the size of the serial numbers of the above-mentioned processes does not mean 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 only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this specification generally indicates that the associated objects before and after are in an "or" relationship.
[0154] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0155] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned 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, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0157] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.
[0158] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0159] If the integrated unit is implemented in the form of 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 is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0160] Specific embodiments are used in this specification to illustrate the principles and implementation methods of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of this specification. At the same time, for those skilled in the art, according to the ideas of this specification, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on 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; According to 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 splicing; Determine whether the batch file to be monitored exists in the absolute path; If it exists, the batch file to be monitored is monitored silently; 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, alarm information is generated according to the log file and the custom information, and the alarm information is fed back to the operation and maintenance personnel.
2. The method according to claim 1, characterized in that The step of obtaining the absolute path of the batch file to be monitored by splicing the file storage path, date type and file name in the configuration file further includes: Determine the generation date of the batch file to be monitored according to 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 according to the date type further includes: If the date type is the first type, determining the date in the file storage path as the generation date; If the date type is the second type, the date in the file storage path after being incremented by one is determined as the generation date; If the date type is the third type, the date in the file name is determined as the generation date; If the date type is the fourth type, the date in the file name after being incremented by one is 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 in the absolute path, the method further includes: Obtaining the file monitoring time in the configuration file; According to the file monitoring time, it is determined whether the monitoring time for the batch file to be monitored has arrived.
5. The method according to claim 1, characterized in that Generating alarm information according to the log file and the custom information further includes: Searching a pre-configured alarm information comparison table according to the alarm field in the log file to obtain alarm cause information; The alarm information is generated according to 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 Generating alarm information according to the log file and the custom information further includes: Inputting the alarm field in the log file into the pre-trained alarm analysis model to obtain alarm cause information; The alarm information is generated according to 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 by the following steps: Obtaining historical batch files with execution exceptions and log files of the historical batch files; Inputting the key fields in the log file into the initial alarm analysis model to obtain the alarm cause information of the historical batch file; Compare the alarm reason information with the real abnormal reason information of the historical batch processing file to obtain a comparison result; The initial alarm analysis model is iteratively trained according to the comparison result until the comparison result is less than a preset error rate threshold or a predetermined number of iterative training times is reached, thereby obtaining the trained alarm analysis model.
8. The method according to claim 1, characterized in that: The method further comprises: Obtain the latest arrival time and processing time in the custom information; The latest arrival time and the time required for processing are fed back to the operation and maintenance personnel.
9. The method according to claim 1, characterized in that: Feeding back the alarm information to the operation and maintenance personnel includes: The alarm information is fed back to the operation and maintenance personnel through one or a combination of log files, system console, and email notification.
10. A batch file monitoring device, characterized in that: include: An execution module, used for executing a check script to read a configuration file of a preset batch file; A splicing module, used for splicing the absolute path of the batch file to be monitored according to the file storage path, date type and file name in the configuration file; A judgment module, used for judging whether the batch file to be monitored exists under the absolute path; A monitoring module, used for silently monitoring 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 it does not exist, generate alarm information according to the log file and the custom information, and feed back the alarm information 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, the method according to any one of claims 1 to 9 is implemented.
12. 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 a processor, the method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that The method comprises at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to 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
Automatic packaging method and device by means of batch processing, computer equipment and storage medium
CN111352641A
Method for detecting quality of batch files
CN113570255A
Alarm information processing method and device, electronic equipment and storage medium
CN119011364A
MES monitoring method, MES monitoring device, and readable storage medium
WO2021097919A1