CN114741227A - Method and device for repairing program fault and electronic equipment - Google Patents

Method and device for repairing program fault and electronic equipment Download PDF

Info

Publication number
CN114741227A
CN114741227A CN202210461312.7A CN202210461312A CN114741227A CN 114741227 A CN114741227 A CN 114741227A CN 202210461312 A CN202210461312 A CN 202210461312A CN 114741227 A CN114741227 A CN 114741227A
Authority
CN
China
Prior art keywords
program
fault
processing scheme
program fault
batch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210461312.7A
Other languages
Chinese (zh)
Inventor
黄显超
帅红波
彭建业
柯星宇
周赞
尹小敏
杜世琼
吴华东
陈芬
李俊华
邓亚丽
陈戈
陈志鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210461312.7A priority Critical patent/CN114741227A/en
Publication of CN114741227A publication Critical patent/CN114741227A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/323Visualisation of programs or trace data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Abstract

The embodiment of the application discloses a method and a device for repairing program faults and electronic equipment, wherein the method comprises the following steps: acquiring logs of batch program operation; wherein the batch program is run to process batch services; when a program fault occurs during the operation of the batch program, determining abnormal data and program fault information according to the log; and when the program fault is determined to have a preset processing scheme according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault so as to improve the efficiency of repairing the program fault.

Description

Method and device for repairing program fault and electronic equipment
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for repairing a program failure, and an electronic device.
Background
With the increase of the amount of business, in the banking business processing scenario, a batch program is generally executed to realize the processing of batch business. When a batch program fails, manual intervention is usually required to analyze and process the failure, so that the program failure is repaired, and then the batch program is continuously run. However, repairing a program failure by way of human intervention is inefficient.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for repairing a program fault, and an electronic device, so as to improve efficiency of repairing the program fault.
In a first aspect, the present application provides a method for repairing a program fault, including:
acquiring logs of batch program operation; running a batch program to process batch services;
when a program fault occurs during the running of the batch program, determining abnormal data and program fault information according to the log;
and when the program fault is determined to have the preset processing scheme according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault.
In a possible implementation manner, when it is determined that the program fault has a preset processing scheme according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault specifically includes:
determining whether the program fault has a preset processing scheme or not according to the abnormal data and the program fault information;
if so, executing a preset processing scheme to repair the program fault.
In one possible implementation, the method further includes:
when the program fault is determined not to have the preset processing scheme, outputting the program fault warning information
In a possible implementation manner, when it is determined that the program fault has a preset processing scheme according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault specifically includes:
and when determining that the processing scheme of the program fault exists in the preset fault processing library according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault.
In a possible implementation manner, the preset processing scheme specifically includes: a fault handling script.
In one possible implementation, the log is obtained through a buried point.
In a second aspect, the present application provides a device for repairing a program failure, the device comprising:
the log acquiring unit is used for acquiring logs during the running of the batch programs; running a batch program to process batch services;
the log analysis unit is used for determining abnormal data and program fault information according to the log when a program fault occurs during the operation of the batch program;
and the fault repairing unit is used for executing the preset processing scheme to repair the program fault when the program fault is determined to have the preset processing scheme according to the abnormal data and the program fault information.
In a possible implementation manner, the failure recovery unit is specifically configured to:
determining whether the program fault has a preset processing scheme or not according to the abnormal data and the program fault information;
if so, executing a preset processing scheme to repair the program fault.
In a third aspect, the present application provides an electronic device, which includes a processor and a memory, where the memory stores codes, and the processor is configured to call the codes stored in the memory to execute any one of the methods described above.
In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program for performing the method of any one of the above.
Drawings
FIG. 1 is a flow chart of a method for repairing program faults provided by an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a device for repairing a program fault according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
When a batch program fails, manual intervention is usually required to analyze and process the failure, so that the program failure is repaired, and then the batch program is continuously run. However, repairing a program failure by way of human intervention is inefficient.
Based on this, in the embodiment of the present application provided by the applicant, a log of the batch program when running is first obtained, wherein the batch program is run to process batch services; when a program fault occurs during the running of the batch program, determining abnormal data and program fault information according to the log; when the program fault information is confirmed according to the abnormal data and the program fault information
By adopting the technical scheme of the embodiment of the application, when the batch program runs and breaks down, the log is obtained and analyzed, when the program fault is identified to have the corresponding preset processing scheme, the processing is carried out according to the preset processing scheme, the preset processing scheme is automatically determined and executed, and the program fault of the batch program is automatically repaired. By adopting the technical scheme of the embodiment of the application, the automatic repair of the program fault can be realized, and the manual intervention is reduced, so that the operation burden is reduced, and the speed and the safety of the operation and maintenance of the program are improved.
In order to facilitate understanding of the technical solutions provided in the embodiments of the present application, a method, an apparatus, and an electronic device for repairing a program fault provided in the embodiments of the present application are described below with reference to the accompanying drawings.
While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Other embodiments, which can be derived by those skilled in the art from the embodiments given herein without any inventive contribution, are also within the scope of the present application.
In the claims and specification of the present application and in the drawings accompanying the description, the terms "comprise" and "have" and any variations thereof, are intended to cover non-exclusive inclusions.
The application provides a method for repairing program faults.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for repairing a program fault according to an embodiment of the present disclosure.
As shown in fig. 1, the method for repairing a program fault in the embodiment of the present application includes S101 to S103.
And S101, acquiring logs of batch program operation.
The batch program is run to process the batch business.
The running program is used to complete the processing of the service, and during the service processing, service processing data is usually generated.
For example, in the context of banking, a customer's financial services are implemented by executing a batch program. When a batch program is run to perform batch business processing, business processing data is generated.
When a fault occurs in executing a batch program, that is, when a program fault occurs, a fault occurs in batch business processing.
S102, when program faults occur during the operation of the batch program, determining abnormal data and program fault information according to the log.
The failure information of the program failure refers to information for identifying or indicating the program failure.
S103, when the program fault is determined to have the preset processing scheme according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault.
When the program fault is determined to have the preset processing scheme according to the abnormal data and the program fault information, the program fault can be repaired by executing the preset processing scheme.
By adopting the technical scheme of the embodiment of the application, when the batch program runs and breaks down, the log is obtained and analyzed, when the program fault is identified to have the corresponding preset processing scheme, the processing is carried out according to the preset processing scheme, the preset processing scheme is automatically determined and executed, and the program fault of the batch program is automatically repaired. By adopting the technical scheme of the embodiment of the application, the automatic repair of the program fault can be realized, and the manual intervention is reduced, so that the operation burden is reduced, and the speed and the safety of the operation and maintenance of the program are improved.
The application also provides another method for repairing the program fault.
The method for repairing the program fault in the embodiment of the application comprises S201-S203.
S201, obtaining a log when the program runs.
In a possible implementation manner, the log of the program in operation may be obtained through the buried point to obtain the data of the program in operation, that is, the data in the service processing process.
In some possible cases, the embedding may be performed at a common embedding position, such as positions of action start and action end, and different embedding positions may be provided for different jobs, such as determining a service fault point according to historical fault information and embedding.
The log can also obtain the fault information of the program fault.
The fault information of the program fault may include one or more of the following: the time when the program fault occurred, the cause code of the program fault, the program code line in error, the stack information of the exception, etc.
The reason code of the program failure is used to indicate the type of failure, etc.
That is, in some possible cases, by logging we get: the time when the program failure occurs, the cause code of the program failure, the wrong program code line, the abnormal stack information, the wrong service data and the like.
In one possible implementation, when a batch of programs executing fails, where the programs fail (i.e., where the failure interrupts process), the failure is captured and a log is printed.
Specifically, the abnormal processing flow is intercepted by a Spring loop (Spring frame attached ordered Programming) technology, and common error time and error code line information are printed.
Spring is one of the frameworks of Java; the above (aspect organized programming) is a technology for realizing unified maintenance of program functions by a pre-compiling mode and a running-time dynamic proxy, and is Oriented to section programming.
The cause code of the error may be uniformly defined in advance.
When the batch program has faults, fault data can be quickly tracked according to the log, such as the reason code of the fault, the code line of the fault, the time of the fault, the service data of the fault and the like.
In some possible cases, the embedding can be performed according to preset embedding point positions and embedding point specifications.
For example, each developer performs a site embedding in accordance with the specification in the branch of processing of an exception in the business process at the time of program development.
After the point burying is finished, when program abnormality occurs, a corresponding abnormality log is printed through a spring aop technology.
In one possible implementation manner, the acquired data is collected into the hive data warehouse according to time through filebeat + logstatck + kafka + hive, and the storage of the log data is completed.
fileteam is a lightweight transport tool for forwarding and collecting log data, monitoring specified log files or locations, collecting log events.
Kafka is a high throughput distributed publish-subscribe messaging system that can handle action flow data.
hive is a data warehouse tool for the storage, query and analysis of incoming data.
The log files are collected through Filebeat, the extracted log files are subjected to format analysis through logstatck, and the log stream is transmitted to the hive data warehouse through kafka.
S202, when the program runs abnormally, determining program faults according to the log
In a possible implementation manner, when a program failure occurs, acquiring a log from a hive data warehouse, and analyzing the acquired log, specifically, the method may include: the time when the program fault occurred, the cause code of the program fault, the program code line in error, the stack information of the exception, etc.
That is, in some possible cases, the time when the program failure occurs, the cause code of the program failure, the erroneous program code line, the stack information of the exception, the erroneous service data, and the like are obtained by the log.
Specifically, erroneous business data is extracted from the log repository through hive sql. For example, for banking, from the extracted business data, it is possible to obtain: which business account number, which customer, which business transaction, etc., thereby preliminarily determining which business scene the program fault belongs to, and improving the accuracy of program fault identification.
S203, judging whether the program fault can be self-healed, and if so, determining a corresponding program fault repairing script; otherwise, outputting program fault warning information.
Program faults are self-healing, meaning that the fault can be repaired by executing an automated processing scheme.
In one possible implementation manner, whether the program fault can be self-healed or not is identified according to fault information of the program fault.
Specifically, the fault information of the program fault may include one or more of the following: the time when the program failure occurred, the cause code of the program failure, the program code line in error, the stack information of the exception, the program name, the job name, the error return code, and the like.
Specifically, a fault handling library, such as a batch exception fault handling plan table, may be preset, where the fault handling library includes a plurality of fault handling schemes.
When the fault processing scheme is executed, the corresponding program fault can be repaired.
When it is determined that the program fault can be self-healed, a fault handling scheme corresponding to the program fault may be determined according to fault information of the program fault.
In a possible implementation manner, the preset fault handling library includes a plurality of fault handling scripts. The fault handling script is configured to handle program faults when executed.
At this time, the severity failure can be repaired by executing an automated script.
And analyzing and deciding according to the fault information of the program fault, and obtaining a fault processing script corresponding to the program fault from the fault processing library.
The batch abnormal fault plan can identify the service abnormality in advance and record, and can also record the after-the-fact fault processing plan and discriminate next time.
And analyzing the acquired data, acquiring a fault error service scene according to the error service data and the fault information of the program fault, and deciding which plan to process according to the service scene.
In some possible cases, a developer can write a fault handling script corresponding to a program fault in advance according to the program fault which may occur, and enter the fault handling script into a fault handling library.
When it is determined that the program fault can self-heal, a processing script corresponding to the program fault is determined. The processing script is corresponding to the program failure, and the processing script is executed to process the program failure.
When it is determined that the program fault cannot be self-healed, the batch fault processing table does not have a processing scheme of the program fault, and at this time, alarm information may be generated to notify maintenance personnel.
In a possible implementation manner, when it is determined that the program fault cannot self-heal, that is, the program fault does not have a corresponding processing scheme in the fault processing library, a processing scheme of the program fault is generated and added to the fault processing library.
S204, executing fault processing script corresponding to program fault
Since the fault handling script is program fault-corresponding, executing the fault handling script can handle the corresponding program fault.
When the program fault is identified to have a corresponding solution (such as a fault processing script) in the plan processing library, the corresponding fault processing script is automatically determined from the fault processing library according to the processing of the plan and is executed.
In one possible implementation, after the execution of the fault handling script is completed, the execution of the batch job may be automatically re-initiated.
In a possible implementation manner, after the fault processing script is executed, a fault processing report may be generated to provide information of fault processing for maintenance personnel.
By adopting the technical scheme of the embodiment of the application, when the batch program runs and breaks down, the log is acquired and analyzed, when the program fault is identified to have the corresponding preset processing scheme, the processing is carried out according to the preset processing scheme, the preset processing scheme is automatically determined and executed, the program fault of the batch program is automatically repaired, the automatic repair of the program fault can be realized, the manual intervention is reduced, the operation burden is reduced, and the speed and the safety of the operation and maintenance of the program are improved.
The application provides a device for repairing program faults.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a device for repairing a program fault according to an embodiment of the present disclosure.
As shown in fig. 2, the apparatus 200 for repairing a program failure in the embodiment of the present application includes the following units:
a log obtaining unit 201, configured to obtain a log when a batch program runs; running a batch program to process batch services;
the log analysis unit 202 is used for determining abnormal data and program fault information according to the log when a program fault occurs during the running of the batch program;
and the fault repairing unit 203 is used for executing a preset processing scheme to repair the program fault when the program fault is determined to have the preset processing scheme according to the abnormal data and the program fault information.
The units included in the apparatus 200 for repairing a program fault can achieve the same technical effects as the method for repairing a program fault in the above embodiments, and are not described herein again to avoid repetition.
The embodiment of the application also provides the electronic equipment.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 3, the electronic device 300 according to the embodiment of the present application includes a processor 301 and a memory 302, where the memory 302 stores codes, and the processor 301 is configured to call the codes stored in the memory 302 to execute any one of the above-mentioned program failure repairing methods.
The units included in the electronic device 300 can achieve the same technical effects as the method for repairing the program fault in the above embodiment, and are not described herein again to avoid repetition.
In an embodiment of the present application, a computer-readable storage medium is further provided, where the computer-readable storage medium is used for storing a computer program, and the computer program is used for executing the method for repairing a program fault, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for repairing a program failure, the method comprising:
acquiring logs of batch program operation; running the batch program to process batch services;
when a program fault occurs during the running of the batch program, determining abnormal data and program fault information according to the log;
and when the program fault is determined to have a preset processing scheme according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault.
2. The method according to claim 1, wherein when it is determined that the program fault has a preset processing scheme according to the exception data and the program fault information, executing the preset processing scheme to repair the program fault specifically includes:
determining whether the program fault has a preset processing scheme or not according to the abnormal data and the program fault information;
and if so, executing the preset processing scheme to repair the program fault.
3. The method of claim 2, further comprising:
and outputting program fault alarm information when the program fault is determined to have no preset processing scheme.
4. The method according to claim 1, wherein when it is determined that the program fault has a preset processing scheme according to the exception data and the program fault information, executing the preset processing scheme to repair the program fault specifically includes:
and when determining that a processing scheme of the program fault exists in a preset fault processing library according to the abnormal data and the program fault information, executing the preset processing scheme to repair the program fault.
5. The method according to claim 1, wherein the predetermined processing scheme specifically comprises: a fault handling script.
6. The method of claim 1, wherein the log is obtained through a buried point.
7. An apparatus for repairing a program failure, the apparatus comprising:
the log acquiring unit is used for acquiring logs during the running of the batch programs; running the batch program to process batch services;
the log analysis unit is used for determining abnormal data and program fault information according to the log when a program fault occurs during the running of the batch program;
and the fault repairing unit is used for executing a preset processing scheme to repair the program fault when the program fault is determined to have the preset processing scheme according to the abnormal data and the program fault information.
8. The apparatus according to claim 7, wherein the failover unit is specifically configured to:
determining whether the program fault has a preset processing scheme or not according to the abnormal data and the program fault information;
and if so, executing the preset processing scheme to repair the program fault.
9. An electronic device comprising a processor and a memory, wherein the memory has code stored therein, and wherein the processor is configured to invoke the code stored in the memory to perform the method of any of claims 1 to 6.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium is adapted to store a computer program for performing the method of any of claims 1 to 6.
CN202210461312.7A 2022-04-28 2022-04-28 Method and device for repairing program fault and electronic equipment Pending CN114741227A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210461312.7A CN114741227A (en) 2022-04-28 2022-04-28 Method and device for repairing program fault and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210461312.7A CN114741227A (en) 2022-04-28 2022-04-28 Method and device for repairing program fault and electronic equipment

Publications (1)

Publication Number Publication Date
CN114741227A true CN114741227A (en) 2022-07-12

Family

ID=82283314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210461312.7A Pending CN114741227A (en) 2022-04-28 2022-04-28 Method and device for repairing program fault and electronic equipment

Country Status (1)

Country Link
CN (1) CN114741227A (en)

Similar Documents

Publication Publication Date Title
CN110704231A (en) Fault processing method and device
US20160299837A1 (en) Software test automation systems and methods
CN110650036A (en) Alarm processing method and device and electronic equipment
CN104809030A (en) Android-based exception handling system and method
CN112183782B (en) Fault work order processing method and equipment
CN109669844B (en) Equipment fault processing method, device, equipment and storage medium
CN111913824A (en) Method for determining data link fault reason and related equipment
CN111782431A (en) Exception processing method, exception processing device, terminal and storage medium
CN111711540A (en) Method and device for identifying government and enterprise business alarm
CN108650123B (en) Fault information recording method, device, equipment and storage medium
CN112363860A (en) Batch processing operation abnormal interruption detection method and device
CN114741227A (en) Method and device for repairing program fault and electronic equipment
CN111680974B (en) Method and device for positioning problems of electronic underwriting process
CN111061580B (en) Computer system emergency plan exercise method, server and system
CN114386894A (en) Logistics abnormity processing method and system, storage medium and electronic equipment
CN111835566A (en) System fault management method, device and system
CN113656003A (en) Software package management method and related equipment
CN111061609A (en) Log monitoring method and system
CN113377467B (en) Information decoupling method and device, server and storage medium
CN113806196B (en) Root cause analysis method and system
CN113094163B (en) Batch operation start-stop method and device, computer equipment and storage medium
KR20000051749A (en) Automatic analyzer of trouble shooting in base station manager system method for solving the trouble
CN117687871A (en) Micro-service monitoring method and device, electronic equipment and storage medium
CN116389066A (en) Method and device for detecting validity of security rule
CN115185806A (en) Application code diagnosis method, device and system

Legal Events

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