A method and system for locating and repairing software faults
By monitoring application status in real time and automating fault handling, the problem of lengthy software fault location and repair processes has been solved, enabling rapid and automated fault repair and improving user experience and operational efficiency.
Patent Information
- Application Number
- CN202111600650.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-12-24
AI Technical Summary
In existing technologies, the process of locating and repairing software faults is lengthy and time-consuming, which affects user experience. In particular, for users who are not familiar with the software architecture, the fault resolution methods are complex and time-consuming, which affects the normal iteration and development of application software.
The fault monitoring program monitors the application's running status in real time, obtains version information, configuration parameters, memory stack call information and file hash values, automatically identifies and repairs abnormal configurations and file corruption, and uses the server to automatically locate the fault location and generate an upgrade package, thus achieving automated fault repair.
It enables rapid and automated software fault location and repair, reducing user waiting time, improving user experience, and alleviating the workload of maintenance personnel.
Smart Images

Figure CN114328101B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software processing, and in particular to a method and system for locating and repairing software faults. Background Art
[0002] In today's society, with the development of computer technology, application software has become an important tool for people's work and even life. With the continuous changes in user needs, application software is also constantly iterating and updating. Different customers have different needs for the same application software. Customization requirements and business changes are complicated and diverse. Different customization requirements and functional adaptation of different application scenarios further increase the complexity of application software. The increase in the complexity of application software also means that the structure of the software is becoming more and more complex and the scale of the software is becoming larger and larger, making software failures inevitable.
[0003] Software failures can be divided into internal failures caused by coding logic vulnerabilities during the functional development of application software, and external failures caused by configuration parameter errors, damaged or missing operating files, and dependent environment configuration errors. The former type of failure requires the application software developers to locate and repair the source code faults, and provide the new version of the application software to users for software updates and upgrades. The latter type of failure only requires reasonable corrections to the configuration parameters and operating environment, and file repairs for damaged or missing operating files. However, for users who are not familiar with the software architecture, the way to solve software failures is usually to feedback the failure situation to the operation and maintenance personnel, and the operation and maintenance personnel will assist in locating the cause of the failure, or the operation and maintenance personnel will feedback the failure situation to the software developers for fault location, and provide new upgrade installation packages after the failure is repaired, resulting in a long and time-consuming process for fault resolution, affecting user experience. And with the large-scale use of application software, the time-consuming proportion of problem feedback and repair of software failures will greatly increase in the entire software life cycle, which will seriously affect the normal iteration and development of application software. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a method and system for locating and repairing software faults that overcome the above problems or at least partially solve the above problems.
[0005] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions:
[0006] A method for locating and repairing software faults, comprising:
[0007] S100. The fault monitoring program monitors the running status of the target application in real time to detect whether the target application is running abnormally;
[0008] S200. When an abnormal running state of the target application is detected, the fault monitoring program obtains the version information, configuration parameter information, memory stack call information file, log information and hash value information of the necessary files of the target application;
[0009] S300. By obtaining the necessary file hash information and configuration information of the application, determine whether the configuration parameters are abnormal, whether the running file is damaged or missing, and whether the operating environment is abnormal; and repair the abnormal configuration parameters, repair the operating environment, and repair damaged or missing application files according to the actual situation;
[0010] S400. The server uses the received fault information to find the code repository path and repository version number of the project version, automatically attaches the memory stack call information file and debugs to locate the fault location;
[0011] S500. The server queries the update record of the code repository, finds the latest version that the abnormal component can support, performs automated construction, integration and packaging, and generates an upgrade package;
[0012] S600. The fault monitoring client receives the upgrade package, performs the upgrade installation, repairs the fault, and updates the verification information file.
[0013] Furthermore, the target application includes a main program and multiple components; the main program is responsible for dynamic loading and management of components, and the components are used to implement specific functions of the target application. Logical decoupling is achieved between components, and the main program and components have independent version numbers.
[0014] Further, in S200, when an abnormal operation of an application is detected, the fault monitoring program obtains the version information of the target application including the version number of the main program of the target application and the version numbers of all included components, the compilation generation time information, and the project type information content; the fault monitoring program retrieves the running files of the target application by file traversal and calculates the hash value of the file; a data recording unit is formed with the relative path, file version number, and calculated hash value of each file, and is saved in the traversal result list; before the target application file is integrated and packaged, it is necessary to calculate the latest hash values of all necessary files, record them in the form of a data recording unit consisting of a relative path, a file version number, and a hash value, save them in a local verification information file, and integrate them into the installation package together with the program file, so as to facilitate data comparison and analysis during subsequent fault judgment; when performing hash calculation on the target application file, only the necessary files of the target application are traversed and calculated, excluding temporary data recording files, log files, and parameter configuration files that may be modified that are generated after the application is running.
[0015] Furthermore, the specific method of S300 is: by reading the parameters in the configuration file, obtaining the configuration status of the configuration parameters currently used by the target application, judging whether the configuration parameters are within the normal allowable range, and whether the network link abnormality between the target application and the server is caused by the parameter configuration; by comparing the hash values of all necessary files of the target application file obtained by traversal calculation with the data content in the verification information file, judging whether there are necessary files of the target application damaged or missing.
[0016] Furthermore, if necessary files of an application are damaged or missing, the fault monitoring program may preferentially detect whether there is a file backup of an installation package or upgrade package of the same version of the application on the computer;
[0017] If a backup file exists, the running file of the application to be repaired is extracted from the backup file, and the file with the same name in the application installation directory is overwritten and replaced;
[0018] If there is no backup file, the fault monitoring program will request and download the program running file of the corresponding version number from the server. After the download is complete, the application running file will be overwritten and replaced to achieve automatic repair of damaged or missing files.
[0019] Furthermore, in S400, for faults that are not caused by abnormal parameter configuration, abnormal operating environment configuration, or damaged or missing operating files, the fault monitoring program sends the collected fault information data to the server, and the service program on the server locates the fault and provides a repair upgrade package.
[0020] Furthermore, the specific method of S400 is:
[0021] S401. The server receives the fault data sent by the fault monitoring program, decompresses and parses the fault data, and extracts the project name, main program, and version number information of each component;
[0022] S402. The server finds a completely matching project engineering code version in the code repository based on the project name, main program, and version numbers of each component;
[0023] S403. Load the found code project, and attach the memory stack call information file to the project, perform automated stack information debugging, determine the fault location and cause, and determine the faulty component;
[0024] S404. Retrieve the version update log record to determine whether the faulty component has been repaired;
[0025] S405. If the fault problem has been corrected, the project code of the component is updated to the latest supported version, and automated construction, integration and packaging are performed to generate an upgrade package;
[0026] S406. Send the upgrade package to the fault monitoring client that reported the abnormality.
[0027] Furthermore, in S500, the fault monitoring program receives the upgrade package sent by the server and executes the installation of the upgrade package to repair the fault.
[0028] The present invention also discloses a system for locating and repairing software faults, including a client and a server, wherein the client is used to run a fault monitoring program, including a target detection module, an information collection module, a fault judgment module, a fault reporting module, and a fault repair module; wherein:
[0029] The target detection module is used to monitor the running status of the target application to be monitored in real time and detect whether the target application is in a normal running state;
[0030] An information collection module is used to obtain the main program version number of the target application and the version number information of all components, configuration parameter information, memory stack call information file, log information, and hash value information of necessary files of the application when it is detected that the working state of the target application is in an abnormal state;
[0031] The fault judgment module is used to judge the cause of the application software failure, whether it is an external fault caused by abnormal configuration parameters, abnormal operating environment, or damaged or missing operating files, or an internal fault caused by other abnormal internal logic of the program; by analyzing the collected configuration parameter information of the target application, it is analyzed whether the abnormal operation of the target application is caused by abnormal parameter configuration. If the configuration parameters exceed the normal allowable range, the configuration items in the parameter configuration file are reset; the hash values of all necessary files in the target application are calculated, and compared with the hash values of the necessary operating files of the target application saved locally, to determine whether the necessary operating files of the target application are deleted or damaged by mistake;
[0032] The fault reporting module, if it is determined that the fault is an internal fault, compresses the fault information collected by the information collection module and sends it to the server; if it is determined that the fault is an external fault caused by damage or loss of the running file, but the backup file cannot be found for restoration, then the name, version information of the application, the name, version information, relative path information of the damaged or missing file, etc. are reported to the server;
[0033] The fault repair module is used to repair faults of the target application; download the damaged or missing necessary operating files from the server or extract them from the local backup files of the computer, and replace and overwrite the necessary operating files to repair the damaged or missing files; or download the update package for fault repair from the server and perform the update installation operation to repair the fault of the target client.
[0034] Furthermore, the server includes a fault management module, a project management module, a code repository module, a fault location module, and an integrated packaging module; wherein:
[0035] The fault management module is used to handle the faults reported by the fault monitoring program and the management of project engineering code faults; if the fault type reported by the fault monitoring program is the damage or loss of the running file of the application software program, the correct file download path is provided for the fault monitoring program to download and repair the file; if the fault type is other types, the received fault information data is parsed and saved, and the fault list information generated after the fault location module analysis is recorded. If the fault has been recorded in the repaired fault list, the corresponding patch repair program or installation package is obtained according to the log description in the repaired fault list for the fault monitoring program to download and Implement fault repair; if the fault is not in the list of repaired faults, add it to the list of faults to be repaired, and send the fault information to the developer through network communication for manual analysis and location, reminding the developer to pay attention to and troubleshoot the software fault in time; after the developer submits the code to the code repository of the server, the fault management module parses the update log when the code is submitted, and compares and matches it with the faults in the list of faults to be repaired. If it is found that the fault in the list of faults to be repaired has been solved, remove the fault from the list of faults to be repaired, add it to the list of repaired faults, and automatically generate a patch repair program for the fault through the integrated packaging module;
[0036] The project management module is used to record and manage the project names, version numbers, and corresponding paths in the code repository of all released versions of the target application, and to back up and save the installation packages, upgrade packages, or running files of the released versions;
[0037] The code repository module is used to store the code of all sub-projects of the target application, and contains the code content of all officially released versions of each sub-project, as well as the corresponding function modification log description and abnormal problem repair log description;
[0038] The fault location module is used to load the appropriate project engineering code selected according to the application version number, and load the memory stack call information file, perform code-level fault analysis of the stack information, and find the faulty component and fault location; if the fault location module does not detect the fault repair information, it automatically generates software fault snapshot information according to the pre-set rules and processes. The software fault snapshot information includes fault environment information, fault level, software call stack information, fault module, fault thread, etc. The software fault snapshot information is saved in the database. If the fault level is high, the fault information can be sent to the developer through network communication for manual analysis and location, reminding the developer to pay attention to and troubleshoot high-risk software faults in a timely manner;
[0039] The integrated packaging module finds the project of the faulty component from the code repository based on the result of fault location, and matches it from the update log to determine whether the fault has been fixed. If the fault has been fixed, the code version of the component after the fault is fixed is obtained based on the update record, and the version is compiled to automatically generate a new component library file. According to the preset integrated packaging configuration, the repaired component and the necessary environment resource files, parameter configuration files, etc. are associated, and integrated and packaged to output an installable upgrade package for fault repair.
[0040] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:
[0041] The present invention discloses a method and system for locating and repairing software faults, including real-time detection of the running state of a target application, obtaining the version information, configuration information, memory stack call information file, log information, and hash values of necessary files of the target application when the target application is detected to be running abnormally; detecting and repairing abnormal application configuration parameters, operating environment, and operating files; uploading the acquired fault information to a server in other cases; after receiving the fault data, the server finds the warehouse address of the corresponding project engineering through the version information, loads the code of the corresponding project engineering, and attaches the memory stack call information file when the fault occurs, and automatically parses the location and cause of the fault; by retrieving the update log of the code warehouse, it is determined whether the analyzed fault location has been corrected; if the fault has been corrected, the code is automatically constructed, integrated and packaged to generate an upgrade package; the fault monitoring client downloads and installs the upgrade package to repair the fault problem. The present invention solves the problem that the existing technology has a long and time-consuming process for solving software faults, which affects the user experience.
[0042] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0044] Figure 1 This is a flowchart of a method for collecting and analyzing software faults in Embodiment 1 of the present invention;
[0045] Figure 2 This is a structural diagram of a system for locating and repairing software faults in Embodiment 1 of the present invention;
[0046] Figure 3 This is a workflow diagram of the client in Embodiment 1 of the present invention;
[0047] Figure 4 This is a workflow diagram of the server in Example 1 of the present invention. DETAILED DESCRIPTION
[0048] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0049] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a method and system for locating and repairing software faults.
[0050] Example 1
[0051] This embodiment discloses a method for locating and repairing software faults. Figure 1 ,include:
[0052] S100. The fault monitoring program monitors the running status of the target application in real time to detect whether the target application is running abnormally;
[0053] S200. When an abnormal running state of the target application is detected, the fault monitoring program obtains the version information, configuration parameter information, memory stack call information file, log information and hash value information of the necessary files of the target application;
[0054] S300. By obtaining the necessary file hash information and configuration information of the application, determine whether the configuration parameters are abnormal, whether the running file is damaged or missing, and whether the operating environment is abnormal; and repair the abnormal configuration parameters, repair the operating environment, and repair damaged or missing application files according to the actual situation;
[0055] S400. The server uses the received fault information to find the code repository path and repository version number of the project version, automatically attaches the memory stack call information file and debugs to locate the fault location;
[0056] S500. The server queries the update record of the code repository, finds the latest version that the abnormal component can support, performs automated construction, integration and packaging, and generates an upgrade package;
[0057] S600. The fault monitoring client receives the upgrade package, performs the upgrade installation, repairs the fault, and updates the verification information file.
[0058] In this embodiment, the framework structure of the target application includes a main program and several components; the main program is responsible for the dynamic loading and management of the components, and the specific functions of the target application are implemented by different components, and the components are logically decoupled, and the main program and components have independent version numbers. The decoupling of the software functions of the components facilitates the functional development and fault location of the software functions, and can also generate an upgrade installation package with minimized capacity after the fault problem is repaired, which is conducive to the download and transmission of the installation package by the fault monitoring program through the network.
[0059] In S100 of the present embodiment, by functionally decoupling the fault collection program from the target application, the working state of the target application will not affect the working state of the fault collection program, and the fault collection program can detect the running state of the target application in real time. By judging whether the process of the target application exists, it is judged whether the target application is running. Combined with the running flag, it can be judged whether the target application is in normal working or normal exit state, and then judged whether the target application crashes abnormally. The fault collection program periodically performs heartbeat response detection on the target application. If the heartbeat response of the target application is detected to be abnormal, it can be judged that the working state of the target application is abnormal, and it may be in a fault state such as program stuck, blocked and suspended. When the fault collection program detects that the target application is running abnormally, the memory stack information of the running process of the target application can be read by attaching a process.
[0060] Before the target application files are integrated and packaged, the latest hash values of all necessary files need to be calculated and recorded as a data recording unit with the file relative path, file version number, and hash value, and saved in a specific verification information file. It is also integrated into the installation package along with the program file to facilitate data comparison and analysis during subsequent fault diagnosis. Each time the application is installed or upgraded, if the necessary running files of the application software have changed, the content in the verification information file needs to be updated synchronously.
[0061] In S200 of this embodiment, when the target application is detected to be abnormal in its running state, the fault monitoring program retrieves the running file of the target application by file traversal and calculates the hash value of the file. When performing the hash calculation of the target application file, only the necessary files of the target application are traversed and calculated, and the temporary data recording files, log files, and parameter configuration files that may be modified generated after the application is running are not included. Only the hash values of the files necessary for the target application to run are calculated. The relative path, file version number, and calculated hash value of each file constitute a data recording unit and are saved in the traversal result list to obtain a hash information list of all the necessary running files of the target application.
[0062] In S300 of this embodiment, the fault monitoring program reads and analyzes the parameter configuration file of the application program to analyze whether the various parameters of the application program are abnormally configured. The abnormally configured parameters are reset to appropriate parameter values within the default normal threshold range.
[0063] By querying the existence of items, keys, and values under a specific path in the computer's registry and the content of the values, it is determined whether the required operating environment patches of the target application have been installed normally and whether the operating environment information has been correctly configured. If the operating environment configuration is abnormal, the target application's environment patches are reinstalled to reset the state of the target application's operating environment.
[0064] By reading the verification information file in the target application installation directory, and comparing and analyzing the content of the verification information file with the data content in the calculated hash information list of the target application, it is determined whether the target application's running files are damaged or missing. For damaged or missing application software running files, first check whether there are backup files of the same version of the target application's installation package or upgrade package, or backup files of other forms of running files. If there are backup files, extract the running files of the application that needs to be repaired from the backup files, copy them to the target application's installation directory, overwrite and replace the files with the same name, and implement file repair;
[0065] If there is no backup file of the installation package or upgrade package, or backup file of other forms of running files on the computer, the fault monitoring program sends a request to the server through the network, and the content of the request sent includes at least the name, version information of the application, the name, version information, relative path information of the damaged or missing file, etc. The server searches the database and provides the download address of the corresponding file. The fault monitoring program downloads the corresponding file, and after the download is complete, the file is copied to the installation directory of the target application to overwrite and replace the file with the same name to achieve file repair;
[0066] In S400 of this embodiment, for a fault that is not caused by abnormal parameter configuration, incorrect operating environment configuration, or damaged or missing operating files, the fault monitoring program sends the collected fault information data to the server, and the service program on the server locates the fault and provides a repair upgrade package. The specific method is as follows:
[0067] S401. The server receives the fault data sent by the fault monitoring program, decompresses and parses the fault data, and extracts the project name, main program, and version number information of each component.
[0068] S402. The server finds a completely matching project engineering code version in the code repository according to the project name, main program, and version numbers of each component.
[0069] S403. Load the found code project, and attach the memory stack call information file to the project, perform automatic stack information debugging, determine the fault location and fault cause, and determine the faulty component.
[0070] S404. Retrieve the version update log record to determine whether the faulty component has been repaired.
[0071] S405. If the fault problem has been corrected, the project code of the component is updated to the latest supported version, and automated construction, integration and packaging are performed to generate an upgrade package.
[0072] S406. Send the upgrade package to the fault monitoring client that reported the abnormality.
[0073] This embodiment also discloses a system for locating and repairing software faults, such as Figure 2 , including: client and server.
[0074] The client is used to run the fault monitoring program, including a target detection module, an information collection module, a fault judgment module, a fault reporting module, and a fault repair module; wherein:
[0075] The target detection module is used to monitor the running status of one or more specified application programs among the target application programs to be detected in real time, and detect the running status of the detected application programs.
[0076] The fault judgment module is used to preliminarily judge the cause of the fault and execute the corresponding fault repair process according to the judgment result. By analyzing the configuration parameter information of the target application collected, it is analyzed whether the abnormal operation of the target application is caused by abnormal parameter configuration. If the configuration parameter exceeds the normal allowable range, the configuration item in the parameter configuration file is reset. The hash value of all necessary files in the target application is calculated, and compared with the hash value of the necessary running files of the target application saved locally to determine whether the necessary running files of the target application are accidentally deleted or damaged.
[0077] The fault reporting module, if it is judged that the fault is an internal fault, compresses the fault information collected by the information collection module and sends it to the server; if it is judged that the fault is an external fault caused by damage or loss of running files, but the backup file cannot be found for restoration, then the application name, version information, damaged or missing file name, version information, relative path information and other contents will be reported to the server.
[0078] The fault repair module is used to repair the faults of the target application. It downloads the damaged or missing necessary operating files from the server or extracts them from the local backup files of the computer, and replaces and overwrites the necessary operating files to repair the damaged or missing files; or downloads the update package for fault repair from the server and performs the update installation operation to repair the faults of the target client. The workflow diagram of the client is as follows: Figure 3 The specific working method has been described in detail above and will not be repeated here.
[0079] In some preferred embodiments, the server includes a fault management module, a project management module, a code repository module, a fault location module, and an integrated packaging module.
[0080] The fault management module is used to handle the faults reported by the fault monitoring program and the management of project engineering code faults. If the fault type reported by the fault monitoring program is the damage or missing of the running file of the application software program, the correct file download path is provided for the fault monitoring program to download and repair the file; if the fault type is other types, the received fault information data is parsed and saved, and the fault list information generated after the fault location module analysis is recorded. If the fault has been recorded in the repaired fault list, the corresponding patch repair program or installation package is obtained according to the log description in the repaired fault list, so that the fault monitoring program can download and repair the fault. If the fault is not in the repaired fault list, it will be added to the list of faults to be repaired, and the fault information will be sent to the developer through network communication for manual analysis and location, reminding the developer to pay attention to and troubleshoot the software fault in time.
[0081] After the developer submits the code to the code repository on the server, the fault management module parses the update log when the code is submitted and compares it with the faults in the list of faults to be fixed. If it is found that the fault in the list of faults to be fixed has been resolved, the fault is removed from the list of faults to be fixed and added to the list of fixed faults. The patch repair program for the fault is automatically generated through the integrated packaging module.
[0082] The project management module is used to record and manage the project names, version numbers, and corresponding paths in the code repository of all released versions of the target application, and to back up and save the installation packages, upgrade packages, or running files of the released versions.
[0083] The code repository module is used to store the code of all sub-projects of the target application, and contains the code content of all officially released versions of each sub-project, as well as the corresponding function modification log description and abnormal problem repair log description.
[0084] The fault location module is used to load the appropriate project engineering code selected according to the application version number, and load the memory stack call information file to perform code-level fault analysis of the stack information to find the faulty component and fault location. If the fault location module does not detect the fault repair information, it will automatically generate software fault snapshot information according to the pre-set rules and processes. The software fault snapshot information includes fault environment information, fault level, software call stack information, fault module, fault thread, etc. The software fault snapshot information is saved in the database. If the fault level is high, the fault information can be sent to the developer through network communication for manual analysis and location, reminding the developer to pay attention to and troubleshoot high-risk software faults in a timely manner.
[0085] The integrated packaging module finds the project of the faulty component from the code repository based on the fault location results, and matches it with the update log to determine whether the fault has been fixed. If the fault has been fixed, the code version of the component after the fault is fixed is obtained based on the update record, and the version is compiled to automatically generate a new component library file. According to the preset integrated packaging configuration, the repaired component and the necessary environment resource files, parameter configuration files, etc. are associated, integrated and packaged, and an installable upgrade package is output for fault repair. The server workflow diagram is as follows: Figure 4 The specific working method has been described in detail above and will not be repeated here.
[0086] In the real-time example of the present invention, when the target application and the fault monitoring program are installed and deployed, if the installation package or the program running file of the target application is effectively backed up and managed, then even if the target application has other faults other than intrinsic faults caused by program code logic errors under network offline conditions, the matching fault monitoring program can perform corresponding fault location and repair under network offline conditions, and can quickly locate and repair application faults without human intervention, which can improve the user experience and reduce the workload of operation and maintenance personnel and even developers in locating and troubleshooting software faults.
[0087] Optionally, after the software developer corrects the discovered fault problem through the source code, the source code can also be synchronized to the code repository, and a new upgrade installation package or update file can be generated. The fault management module can be used to notify all fault monitoring programs that have a network connection with the server, or the fault repair module of the fault monitoring program can actively and periodically request whether there is a newer version of the application's upgrade installation package or update file. When a newer version of the upgrade installation package or update file is detected, the upgrade program or update file can be downloaded to perform timely fault repair, thereby avoiding the recurrence of the fault.
[0088] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.
[0089] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
[0090] Those skilled in the art will also appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly illustrate the interchangeability between hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on specific applications and the design constraints imposed on the entire system. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as departing from the scope of protection of the present disclosure.
[0091] The steps of the method or algorithm described in conjunction with the embodiments herein may be directly embodied as hardware, a software module executed by a processor, or a combination thereof. The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may be located in a user terminal. Of course, the processor and the storage medium may also be present in a user terminal as discrete components.
[0092] For software implementation, the techniques described in this application can be implemented with modules (e.g., procedures, functions, etc.) that perform the functions described in this application. These software codes can be stored in a memory unit and executed by a processor. The memory unit can be implemented within the processor or outside the processor. In the latter case, it is coupled to the processor in a communication manner via various means, which are well known in the art.
[0093] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".
Claims
1. A method for locating and repairing software faults, characterized in that: include: S100. The fault monitoring program monitors the running status of the target application in real time to detect whether the target application is running abnormally; S200. When an abnormal running state of the target application is detected, the fault monitoring program obtains the version information, configuration parameter information, memory stack call information file, log information and hash value information of the necessary files of the target application; S300. By obtaining the necessary file hash information and configuration information of the application, determine whether the configuration parameters are abnormal, whether the running file is damaged or missing, and whether the running environment is abnormal; And repair abnormal configuration parameters, repair the operating environment, and repair damaged or missing application files according to actual conditions; S400. The server uses the received fault information to find the code repository path and repository version number of the project version, automatically attaches the memory stack call information file and debugs to locate the fault location; S500. The server queries the update record of the code repository, finds the latest version that the abnormal component can support, performs automated construction, integration and packaging, and generates an upgrade package; S600. The fault monitoring client receives the upgrade package, performs the upgrade installation, repairs the fault, and updates the verification information file.
2. A method for locating and repairing software faults as claimed in claim 1, characterized in that: The target application includes a main program and multiple components; the main program is responsible for the dynamic loading and management of components, and the components are used to implement the specific functions of the target application. The components are logically decoupled, and the main program and components have independent version numbers.
3. A method for locating and repairing software faults as claimed in claim 1, characterized in that: In S200, when an abnormal operation of an application is detected, the fault monitoring program obtains version information of the target application including the version number of the main program of the target application and the version numbers of all components included, the compilation generation time information, and the project type information content; the fault monitoring program retrieves the running file of the target application by file traversal and calculates the hash value of the file; The relative path, file version number and calculated hash value of each file constitute a data record unit and are saved in the traversal result list; before the target application file is integrated and packaged, it is necessary to calculate the latest hash values of all necessary files, record them in the form of file relative path, file version number and hash value as a data record unit, save them in the local verification information file, and integrate them into the installation package together with the program file to facilitate data comparison and analysis during subsequent fault diagnosis; when performing hash calculation on the target application file, only the necessary files of the target application are traversed and calculated, excluding temporary data record files, log files and parameter configuration files that may be modified after the application is running.
4. A method for locating and repairing software faults as claimed in claim 1, characterized in that: The specific method of S300 is: by reading the parameters in the configuration file, obtaining the configuration status of the configuration parameters currently used by the target application, judging whether the configuration parameters are within the normal allowable range, and whether the network link between the target application and the server is abnormal due to the parameter configuration; By comparing the hash values of all necessary files of the target application program obtained by traversal calculation with the data content in the verification information file, it is determined whether any necessary files of the target application program are damaged or missing.
5. A method for locating and repairing software faults as claimed in claim 4, characterized in that: If necessary files of an application are damaged or missing, the fault monitoring program can first detect whether there is a file backup of the same version of the installation package or upgrade package of the application on the computer; If a backup file exists, the running file of the application to be repaired is extracted from the backup file, and the file with the same name in the application installation directory is overwritten and replaced; If there is no backup file, the fault monitoring program will request and download the program running file of the corresponding version number from the server. After the download is complete, the application running file will be overwritten and replaced to achieve automatic repair of damaged or missing files.
6. A method for locating and repairing software faults as claimed in claim 1, characterized in that: In S400, for faults that are not caused by abnormal parameter configuration, abnormal operating environment configuration, or damaged or missing operating files, the fault monitoring program sends the collected fault information data to the server, and the service program on the server locates the fault and provides a repair upgrade package.
7. A method for locating and repairing software faults as claimed in claim 6, characterized in that: The specific method of S400 is: S401. The server receives the fault data sent by the fault monitoring program, decompresses and parses the fault data, and extracts the project name, main program, and version number information of each component; S402. The server finds a completely matching project engineering code version in the code repository based on the project name, main program, and version numbers of each component; S403. Load the found code project, and attach the memory stack call information file to the project, perform automated stack information debugging, determine the fault location and cause, and determine the faulty component; S404. Retrieve the version update log record to determine whether the faulty component has been repaired; S405. If the fault problem has been corrected, the project code of the component is updated to the latest supported version, and automated construction, integration and packaging are performed to generate an upgrade package; S406. Send the upgrade package to the fault monitoring client that reported the abnormality.
8. A method for locating and repairing software faults as claimed in claim 1, characterized in that: In step S500, the fault monitoring program receives the upgrade package sent by the server and executes the installation of the upgrade package to repair the fault.
9. A system for locating and repairing software faults, characterized in that: It includes a client and a server. The client is used to run a fault monitoring program, including a target detection module, an information collection module, a fault judgment module, a fault reporting module, and a fault repair module; wherein: The target detection module is used to monitor the running status of the target application to be monitored in real time and detect whether the target application is in a normal running state; An information collection module is used to obtain the main program version number of the target application and the version number information of all components, configuration parameter information, memory stack call information file, log information, and hash value information of necessary files of the application when it is detected that the working state of the target application is in an abnormal state; The fault judgment module is used to judge the cause of the application software failure, whether it is an external fault caused by abnormal configuration parameters, abnormal operating environment, or damaged or missing operating files, or an internal fault caused by other abnormal internal logic of the program; by analyzing the collected configuration parameter information of the target application, it is analyzed whether the abnormal operation of the target application is caused by abnormal parameter configuration. If the configuration parameters exceed the normal allowable range, the configuration items in the parameter configuration file are reset; the hash values of all necessary files in the target application are calculated, and compared with the hash values of the necessary operating files of the target application saved locally, to determine whether the necessary operating files of the target application are deleted or damaged by mistake; The fault reporting module, if it is determined that the fault is an internal fault, compresses the fault information collected by the information collection module and sends it to the server; if it is determined that the fault is an external fault caused by damage or loss of the running file, but the backup file cannot be found for restoration, then the name, version information of the application, the name, version information, relative path information of the damaged or missing file, etc. are reported to the server; The fault repair module is used to repair faults of the target application; download the damaged or missing necessary operating files from the server or extract them from the local backup files of the computer, and replace and overwrite the necessary operating files to repair the damaged or missing files; or download the update package for fault repair from the server and perform the update installation operation to repair the fault of the target client.
10. A system for locating and repairing software faults as claimed in claim 9, characterized in that: The server includes a fault management module, a project management module, a code repository module, a fault location module, and an integrated packaging module; among which: The fault management module is used to handle the faults reported by the fault monitoring program and the management of project engineering code faults; if the fault type reported by the fault monitoring program is the damage or loss of the running file of the application software program, the correct file download path is provided for the fault monitoring program to download and repair the file; if the fault type is other types, the received fault information data is parsed and saved, and the fault list information generated after the fault location module analysis is recorded. If the fault has been recorded in the repaired fault list, the corresponding patch repair program or installation package is obtained according to the log description in the repaired fault list for the fault monitoring program to download and Implement fault repair; if the fault is not in the list of repaired faults, add it to the list of faults to be repaired, and send the fault information to the developer through network communication for manual analysis and location, reminding the developer to pay attention to and troubleshoot the software fault in time; after the developer submits the code to the code repository of the server, the fault management module parses the update log when the code is submitted, and compares and matches it with the faults in the list of faults to be repaired. If it is found that the fault in the list of faults to be repaired has been solved, remove the fault from the list of faults to be repaired, add it to the list of repaired faults, and automatically generate a patch repair program for the fault through the integrated packaging module; The project management module is used to record and manage the project names, version numbers, and corresponding paths in the code repository of all released versions of the target application, and to back up and save the installation packages, upgrade packages, or running files of the released versions; The code repository module is used to store the code of all sub-projects of the target application, and contains the code content of all officially released versions of each sub-project, as well as the corresponding function modification log description and abnormal problem repair log description; The fault location module is used to load the appropriate project engineering code selected according to the application version number, and load the memory stack call information file, perform code-level fault analysis of the stack information, and find the faulty component and fault location; if the fault location module does not detect the fault repair information, it automatically generates software fault snapshot information according to the pre-set rules and processes. The software fault snapshot information includes fault environment information, fault level, software call stack information, fault module, fault thread, etc. The software fault snapshot information is saved in the database. If the fault level is high, the fault information can be sent to the developer through network communication for manual analysis and location, reminding the developer to pay attention to and troubleshoot high-risk software faults in a timely manner; The integrated packaging module finds the project of the faulty component from the code repository based on the result of fault location, and matches it from the update log to determine whether the fault has been fixed. If the fault has been fixed, the code version of the component after the fault is fixed is obtained based on the update record, and the version is compiled to automatically generate a new component library file. According to the preset integrated packaging configuration, the repaired component and the necessary environment resource files, parameter configuration files, etc. are associated, and integrated and packaged to output an installable upgrade package for fault repair.
Citation Information
Cited By
Electronic device and method for detecting abnormal network traffic of application thereof
TWI924354B
