Fault diagnosis method and device, electronic equipment and storage medium
By obtaining fault diagnosis configuration information, displaying operation information, and using preset rules for analysis and diagnosis, the problem of low fault diagnosis efficiency of large-scale software services is solved, efficient and accurate fault diagnosis is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510029176.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the fault diagnosis efficiency of large-scale software services is low and the diagnostic effect is poor.
When receiving the fault diagnosis instruction, obtain the fault diagnosis configuration information, determine the target diagnostic object, display the operation information, analyze the information using preset analysis rules, and use preset diagnosis rules to diagnose, realize automatic diagnosis of software service failures.
It improves the efficiency and accuracy of software service fault diagnosis, reduces the dependence on the experience of operation and maintenance personnel, ensures the consistency of fault diagnosis results, and improves user experience.
Smart Images

Figure CN120029802A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a fault diagnosis method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of information technology, the scale and functionality of software services are constantly expanding. Modern software services are often composed of multiple modules, components, and codes at different levels that collaborate with each other, running on complex network environments and diverse hardware infrastructures. This complexity makes software services face many potential failure points during operation.
[0003] Traditional software fault diagnosis mainly relies on manual experience and simple debugging tools. When a software service fails, the operation and maintenance personnel usually use their own experience to gradually troubleshoot possible causes of the failure based on user feedback or system error information. This approach may work for simple failures, but for complex software service failures, this approach has low diagnostic efficiency and poor diagnostic results. Summary of the invention
[0004] In view of this, embodiments of the present application provide a fault diagnosis method, device, electronic device and storage medium to solve the problem of low efficiency in fault diagnosis of large-scale software services in the prior art.
[0005] In a first aspect of an embodiment of the present application, a fault diagnosis method is provided, the method being used to diagnose a fault of a software service, the method comprising:
[0006] In response to receiving the fault diagnosis instruction, acquiring fault diagnosis configuration information, and determining a target diagnosis object based on the fault diagnosis configuration information, wherein the target diagnosis object includes a target service in the software service;
[0007] Call object display instructions to display the running information of software services;
[0008] Obtaining preset parsing rules, parsing the operation information based on the preset parsing rules, and obtaining the parsed operation information of the target diagnosis object;
[0009] Obtain preset diagnostic rules, diagnose and analyze the operating information based on the preset diagnostic rules, and obtain the fault diagnosis result of the software service.
[0010] In some embodiments, obtaining fault diagnosis configuration information includes:
[0011] Obtaining pre-stored fault diagnosis configuration information from a preset database; or
[0012] Configure software service fault diagnosis on the fault diagnosis page to obtain fault diagnosis configuration information.
[0013] In some embodiments, the fault diagnosis configuration information includes at least one of the following:
[0014] The process identifier, middleware identifier, middleware running port, configuration file, and running log path of the software service to be fault diagnosed;
[0015] Determining the target diagnosis object based on the fault diagnosis configuration information includes:
[0016] Obtaining the process identifier and middleware identifier in the fault diagnosis configuration information;
[0017] Determining the process corresponding to the process identifier and the middleware corresponding to the middleware identifier as the target diagnosis object.
[0018] In some embodiments, parsing the running information based on a preset parsing rule includes:
[0019] Obtaining the preset parsing rule;
[0020] Traversing the running information, matching each piece of running information with the preset parsing rule to obtain the running information of the target diagnosis object after parsing;
[0021] Among them, the parsed running information includes at least one of the following:
[0022] The process identifier of the target diagnosis object, the resource occupancy rate of the process of the target diagnosis object, the middleware identifier of the target diagnosis object, and the middleware running port of the target diagnosis object.
[0023] In some embodiments, diagnosing the parsed running information based on a preset diagnosis rule includes:
[0024] In response to determining that the parsed running information does not include the process identifier of the target diagnosis object, determining that the diagnosis result of the software service is faulty;
[0025] In response to determining that the parsed running information includes the process identifier of the target diagnosis object and the resource occupancy rate of the process of the target diagnosis object is greater than the preset threshold, determining that the diagnosis result of the software service is faulty;
[0026] In response to determining that the parsed running information does not include the middleware identifier of the target diagnosis object, determining that the diagnosis result of the software service is faulty;
[0027] In response to determining that the parsed running information includes the middleware identifier of the target diagnosis object and the middleware running port of the target diagnosis object in the running information is different from the middleware running port of the target diagnosis object in the fault diagnosis configuration information, determining that the diagnosis result of the software service is faulty.
[0028] In some embodiments, after obtaining the fault diagnosis result of the software service, the method further includes:
[0029] In response to determining that a fault exists based on the fault diagnosis result, obtaining a configuration file and an operation log path of a software service corresponding to the fault from the configuration information;
[0030] Use the path information to obtain the running log of the software service corresponding to the fault;
[0031] Perform exception analysis based on configuration files and operation logs.
[0032] In some embodiments, the software service runs on a Linux operating system, and the object display instructions include top instructions and netstat instructions.
[0033] A second aspect of the embodiments of the present application provides a fault diagnosis device, including:
[0034] an acquisition module, configured to acquire fault diagnosis configuration information in response to receiving a fault diagnosis instruction, and determine a target diagnosis object based on the fault diagnosis configuration information, wherein the target diagnosis object includes a target service in the software service;
[0035] A display module is configured to call an object display instruction to display the running information of the software service;
[0036] The parsing module is configured to obtain preset parsing rules, parse the operation information based on the preset parsing rules, and obtain the parsed operation information of the target diagnosis object;
[0037] The diagnosis module is configured to obtain preset diagnosis rules, diagnose and analyze the operation information based on the preset diagnosis rules, and obtain the fault diagnosis result of the software service.
[0038] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0039] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0040] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain fault diagnosis configuration information when receiving a fault diagnosis instruction, determine the target diagnosis object based on the fault diagnosis configuration information, call the object display instruction to display the operation information of the target diagnosis object, and parse the operation information using preset parsing rules, and diagnose the parsed operation information using preset diagnostic rules, thereby realizing automatic diagnosis of software service faults, improving diagnosis efficiency and accuracy, and eliminating the need to rely on the experience of software service operation and maintenance personnel, thereby ensuring the consistency of fault diagnosis results and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 It is a flowchart of a fault diagnosis method provided in an embodiment of the present application.
[0043] Figure 2 It is a flowchart of a method for obtaining fault diagnosis configuration information provided in an embodiment of the present application.
[0044] Figure 3 It is a flowchart of a method for determining a target diagnosis object based on fault diagnosis configuration information provided in an embodiment of the present application.
[0045] Figure 4 It is a flowchart of a method for parsing operation information based on preset parsing rules provided in an embodiment of the present application.
[0046] Figure 5 It is a flowchart of a method for diagnosing and parsing operating information based on preset diagnostic rules provided in an embodiment of the present application.
[0047] Figure 6 It is a flowchart of another fault diagnosis method provided in an embodiment of the present application.
[0048] Figure 7 It is a flowchart of another fault diagnosis method provided in an embodiment of the present application.
[0049] Figure 8 It is a schematic diagram of the software service process configuration information.
[0050] Fig. 9 It is a schematic diagram of the software service middleware configuration information.
[0051] Fig.10 It is a schematic diagram of the execution page of the fault detection method provided in the embodiment of the present application.
[0052] Fig.11 It is a schematic diagram of a fault diagnosis device provided in an embodiment of the present application.
[0053] Fig.12 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0055] A fault diagnosis method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0056] As mentioned above, traditional software fault diagnosis mainly relies on manual experience and simple debugging tools. When a software service fails, operation and maintenance personnel usually use their own experience to gradually troubleshoot possible causes of the failure based on user feedback or system error information.
[0057] For complex software service failures, operation and maintenance personnel may not be able to appear at the fault site immediately, making it difficult to complete fault diagnosis and perform fault recovery in a timely manner. On the other hand, when software services are highly complex and diverse, manual diagnosis is prone to missing key information, resulting in inaccurate or incomplete diagnostic results. In addition, the technical level and experience of different operation and maintenance personnel vary greatly, making it difficult to ensure consistency in fault diagnosis.
[0058] In view of this, an embodiment of the present application provides a fault diagnosis method, which obtains fault diagnosis configuration information when receiving a fault diagnosis instruction, determines a target diagnosis object based on the fault diagnosis configuration information, calls an object display instruction to display the operation information of the target diagnosis object, and parses the operation information using preset parsing rules, and diagnoses the parsed operation information using preset diagnostic rules, thereby realizing automatic diagnosis of software service faults, improving diagnostic efficiency and accuracy, and eliminating the need to rely on the experience of software service operation and maintenance personnel, thereby ensuring the consistency of fault diagnosis results and improving user experience.
[0059] Figure 1 FIG. 1 is a flow chart of a fault diagnosis method provided in an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0060] In step S101 , in response to receiving a fault diagnosis instruction, fault diagnosis configuration information is acquired, and a target diagnosis object is determined based on the fault diagnosis configuration information.
[0061] The target diagnosis object includes the target service in the software service.
[0062] In step S102, the object display instruction is called to display the running information of the software service.
[0063] In step S103, a preset analysis rule is obtained, and the operation information is analyzed based on the preset analysis rule to obtain the analyzed operation information of the target diagnosis object.
[0064] In step S104, a preset diagnosis rule is obtained, and the parsed operation information is diagnosed based on the preset diagnosis rule to obtain a fault diagnosis result of the software service.
[0065] In some embodiments of the present application, the method may be executed by a server or a terminal device with certain processing capabilities. In one example, the fault diagnosis method provided in the embodiment of the present application may be installed on a server or a terminal device, and the fault diagnosis of the software service may be realized by executing the method in the server or the terminal device.
[0066] In certain embodiments of the present application, upon receiving a fault diagnosis instruction, fault diagnosis configuration information may be obtained. The fault diagnosis instruction may be an external input instruction, such as a fault diagnosis instruction input by a user. Alternatively, the fault diagnosis instruction may be an instruction generated by a server or terminal device itself, such as a fault diagnosis instruction automatically generated in response to an abnormal signal sent by another device or program, or an instruction generated on a regular basis.
[0067] The fault diagnosis configuration information can be used to indicate the software services that need to be diagnosed for a fault, and the relevant parameters of each software service. The target diagnosis object can be determined based on the fault diagnosis configuration information, and the target diagnosis object includes a target service in the software service. The target service is the software service that needs to be diagnosed for a fault.
[0068] In some embodiments of the present application, after determining the target diagnostic object, an object display instruction may be called to display the running information of the software service. That is, the running information of the target diagnostic object may be displayed through the object display instruction.
[0069] In some embodiments of the present application, after obtaining the operating information of the target diagnostic object, a preset parsing rule can be obtained, and the operating information of the target diagnostic object can be parsed based on the preset parsing rule to obtain the parsed operating information of the target diagnostic object. Furthermore, a preset diagnostic rule can also be obtained, and the parsed operating information can be diagnosed based on the preset diagnostic rule to obtain a fault diagnosis result of the software service.
[0070] According to the technical solution provided in the embodiment of the present application, by obtaining fault diagnosis configuration information when receiving a fault diagnosis instruction, determining the target diagnosis object based on the fault diagnosis configuration information, calling the object display instruction to display the operation information of the target diagnosis object, and parsing the operation information using preset parsing rules, and diagnosing the parsed operation information using preset diagnostic rules, automatic diagnosis of software service faults is achieved, the diagnosis efficiency and accuracy are improved, and there is no need to rely on the experience of software service operation and maintenance personnel, which ensures the consistency of fault diagnosis results and improves user experience.
[0071] Figure 2 It is a flowchart of a method for obtaining fault diagnosis configuration information provided in an embodiment of the present application.
[0072] like Figure 2 As shown, the method comprises the following steps:
[0073] In step S201, pre-stored fault diagnosis configuration information is obtained from a preset database.
[0074] In step S202, software service fault diagnosis configuration is performed on the fault diagnosis page to obtain fault diagnosis configuration information.
[0075] In some embodiments of the present application, obtaining the fault diagnosis configuration information may be to obtain the pre-stored fault diagnosis configuration information from a preset database. That is, the fault diagnosis configuration information is pre-configured and stored in a preset database. The preset database may be, for example, a database set in a server or terminal device that executes the fault diagnosis method, or a database that can be accessed by the server or terminal device that executes the fault diagnosis method.
[0076] On the other hand, the fault diagnosis configuration information can also be obtained by performing software service fault diagnosis configuration on the fault diagnosis page to obtain the fault diagnosis configuration information. That is, the fault diagnosis configuration information can be obtained by real-time configuration. For example, when the fault diagnosis method is started or when a fault diagnosis instruction is received, a configuration page can be displayed on the interface of the server or terminal device, and the user can configure the fault diagnosis configuration information on the configuration page.
[0077] In some implementations, when a fault diagnosis instruction is received, the fault diagnosis configuration information may be first obtained from a database. If the fault diagnosis configuration information cannot be obtained from the database, a configuration page is provided for the user to configure the fault diagnosis configuration information.
[0078] In other implementations, when a fault diagnosis instruction is received, a configuration page can be provided for the user to configure the fault diagnosis configuration information by themselves, and an option for obtaining the fault diagnosis configuration information from a database can be provided on the configuration page. Alternatively, after the user chooses not to configure the fault diagnosis configuration information by themselves, an option for obtaining the fault diagnosis configuration information from a database can be provided.
[0079] That is to say, a variety of different methods for acquiring fault diagnosis configuration information may be provided, and the execution priority of various acquisition methods may also be set according to actual needs.
[0080] In certain embodiments of the present application, the fault diagnosis configuration information may include at least one of the following: a process identifier of a software service to be fault diagnosed, a middleware identifier, a middleware operation port, a configuration file, and an operation log path.
[0081] That is, when setting the fault diagnosis configuration information, one or more of the process ID, middleware ID, middleware operation port, configuration file and operation log path of the software service to be fault diagnosed may be set.
[0082] Figure 3 FIG. 1 is a flow chart of a method for determining a target diagnosis object based on fault diagnosis configuration information provided by an embodiment of the present application. Figure 3 As shown, the method comprises the following steps:
[0083] In step S301, the process identifier and the middleware identifier in the fault diagnosis configuration information are obtained.
[0084] In step S302, it is determined that the process corresponding to the process identifier and the middleware corresponding to the middleware identifier are target diagnosis objects.
[0085] In certain embodiments of the present application, when determining the target diagnosis object based on fault diagnosis configuration information, the process identifier and middleware identifier in the fault diagnosis configuration information can be first obtained, and then the process corresponding to the process identifier and the middleware corresponding to the middleware identifier are determined as the target diagnosis object.
[0086] For example, if the process identifier is set to process m to process n and the middleware identifier is set to middleware i to middleware j in the fault diagnosis configuration information, it can be determined that in the server or terminal device, process m to process n in the currently running processes and middleware i to middleware j in the currently working middleware are the target diagnosis objects.
[0087] Figure 4 1 is a flow chart of a method for parsing operation information based on preset parsing rules provided in an embodiment of the present application. Figure 4 As shown, the method comprises the following steps:
[0088] In step S401, a preset parsing rule is obtained.
[0089] In step S402, the operation information is traversed, and each piece of operation information is matched with a preset parsing rule to obtain the parsed operation information of the target diagnosis object.
[0090] The parsed operation information includes at least one of the following: a process identifier of a target diagnosis object, a resource occupancy rate of a process of the target diagnosis object, a middleware identifier of the target diagnosis object, and a middleware operation port of the target diagnosis object.
[0091] In certain embodiments of the present application, when parsing operation information based on preset parsing rules, the preset parsing rules can be first obtained, and then the operation information is traversed to match each piece of operation information with the preset parsing rules to obtain the parsed operation information of the target diagnosis object.
[0092] That is, the running information of the software service displayed by calling the object display instruction may include multiple pieces of running information, each piece of running information corresponds to a software service, and the data format of each piece of running information may be different.
[0093] Each piece of operation information can be analyzed in turn using the preset analysis rules to extract the operation information of the target diagnosis object. At the same time, during the analysis, the data format of each piece of operation information can also be converted into the format specified by the analysis rules.
[0094] By adopting this method, the operation information of the target diagnosis object can be efficiently extracted and parsed from the large amount of software service operation information in different formats, providing an accurate data basis for subsequent fault diagnosis.
[0095] Figure 5 1 is a flow chart of a method for diagnosing and parsing operating information based on preset diagnostic rules provided in an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:
[0096] In step S501 , in response to determining that the parsed running information does not include a process identifier of a target diagnosis object, it is determined that a diagnosis result of the software service is that a fault exists.
[0097] In step S502, in response to determining that the parsed operation information includes the process identifier of the target diagnosis object and the resource occupancy rate of the process of the target diagnosis object is greater than a preset threshold, it is determined that the diagnosis result of the software service is a fault.
[0098] In step S503, in response to determining that the parsed operation information does not include the middleware identifier of the target diagnosis object, it is determined that the diagnosis result of the software service is that a fault exists.
[0099] In step S504, in response to determining that the parsed operation information includes the middleware identifier of the target diagnosis object, and the middleware operation port of the target diagnosis object in the operation information is different from the middleware operation port of the target diagnosis object in the fault diagnosis configuration information, it is determined that the diagnosis result of the software service is a fault.
[0100] In certain embodiments of the present application, the implementation method of diagnosing the parsed operation information based on the preset diagnosis rules can be that if the parsed operation information does not include the process identifier of the target diagnosis object, the diagnosis result of the software service is determined to be a fault; if the parsed operation information includes the process identifier of the target diagnosis object, and the resource occupancy rate of the process of the target diagnosis object is greater than a preset threshold, the diagnosis result of the software service is determined to be a fault. Among them, the preset threshold can be set and adjusted according to actual needs, and is not limited here.
[0101] On the other hand, if the parsed operation information does not include the middleware identifier of the target diagnosis object, the diagnosis result of the software service is determined to be a fault; if the parsed operation information includes the middleware identifier of the target diagnosis object, and the middleware operation port of the target diagnosis object in the operation information is different from the middleware operation port of the target diagnosis object in the fault diagnosis configuration information, then the diagnosis result of the software service is determined to be a fault.
[0102] In addition, the preset diagnostic rules can also be set and adjusted according to actual needs, and there is no restriction here.
[0103] Figure 6 is a flow chart of another fault diagnosis method provided in an embodiment of the present application. Figure 6 Steps S601 to S604 in the embodiment shown are Figure 1 Steps S101 to S104 in the illustrated embodiment are substantially the same and will not be described in detail herein. Figure 6 As shown, the method also includes the following steps:
[0104] In step S605, in response to determining that a fault exists based on the fault diagnosis result, a configuration file and an operation log path of a software service corresponding to the fault are obtained from the configuration information.
[0105] In step S606, the path information is used to obtain the operation log of the software service corresponding to the fault.
[0106] In step S607, an abnormality analysis is performed based on the configuration file and the operation log.
[0107] In some embodiments of the present application, after obtaining the fault diagnosis result of the software service, if the fault diagnosis result is that there is a fault, the configuration file and the operation log path of the software service corresponding to the fault can be obtained from the configuration information. Then, the operation log of the software service corresponding to the fault is obtained from the operation log path. Finally, the configuration file and the operation log are used to perform abnormal analysis.
[0108] In some embodiments of the present application, the software service may run on a Linux operating system, and the object display instructions may include top instructions and netstat instructions.
[0109] Figure 7 FIG. 1 is a flow chart of another fault diagnosis method provided in an embodiment of the present application. Figure 7 As shown, before performing fault diagnosis, the name of the service process, the name of the middleware, the listening port, the configuration file and the path of the running log can be stored in the database in advance, or the above information can be configured on the page.
[0110] After the configuration is completed, one-click detection can be performed. One-click detection can include process detection and middleware monitoring. Process detection can be achieved by calling and executing top related commands in the background, and middleware monitoring can be achieved by calling and executing netstat related commands in the background. Among them, top related commands are used to query all process details, and netstat commands are used to query all network information details.
[0111] After one-click detection, the returned detection results can be obtained. The detection results obtained by querying the top command and netstat command are very comprehensive, but also very messy, so it is necessary to combine the configuration information and the corresponding parsing rules for comprehensive analysis and extraction.
[0112] Figure 8 It is a schematic diagram of the software service process configuration information. Fig. 9 It is a schematic diagram of the configuration information of the software service middleware. Figure 8 and Fig. 9 As shown, the configuration information of the process and middleware of the software service can be set in the configuration table, and the configuration information is saved in the form of a configuration table. Figure 8 and Fig. 9 The configuration information and preset analysis rules and diagnosis rules shown can be used to diagnose the faults of the one-key detection results.
[0113] In one example, the one-key detection result can be parsed by preset parsing rules to obtain the required fields, which can be process ID, process name, CPU (Computer Processing Unit) usage, memory usage, port monitoring results, etc.
[0114] In another example, the parsed fields can be combined with detection rules to determine whether the process or middleware is abnormal. For example, the configuration information can be filtered in the detection results to determine whether the process to be detected exists, and if so, whether it is normal. For another example, the usage of resources such as memory and CPU can be monitored based on diagnostic rules. If the resource usage of the process reaches a preset threshold (such as memory usage reaches 50%), a fault prompt is given. For another example, port monitoring can be performed based on diagnostic rules. If the port monitoring result of the process is inconsistent with the configured port, a fault prompt is given.
[0115] That is to say, the detection results can be parsed based on the parsing rules to obtain parsed data, and the parsed data can be diagnosed using the diagnostic rules to obtain the diagnostic results, and then the software service process can be judged based on the diagnostic results to determine whether it is normal. The above parsing rules and detection rules can be built-in or configured later, and the detection results and these rules are matched in sequence, that is, all parsing rules are matched first, then all detection rules are matched, and finally the fault diagnosis results are output.
[0116] If an abnormality occurs in the service process or middleware diagnosis, the configuration files and operation log reports of the service process and middleware can be downloaded through the built-in or configured address path. The downloaded reports will be compressed and encrypted to ensure the security of the background running data. Finally, the abnormal process can be analyzed and processed through the configuration files and operation logs.
[0117] On the other hand, if the service process or middleware is diagnosed as normal, the process details and port monitoring results are returned respectively without performing additional operations.
[0118] Fig.10 Schematic diagram of the execution page of the fault detection method provided in the embodiment of the present application. Fig.10 As shown, after completing the fault diagnosis information configuration, you can click one-click detection on the interface to perform fault diagnosis, and click one-click detection report or download the detection report to obtain the detection results, thereby automatically detecting software service faults. It is easy to operate and does not need to rely on the personal experience of operation and maintenance personnel. It has high universality.
[0119] The technical solution provided in the embodiment of the present application utilizes the Linux system commands "top", "netstat" and other tools to diagnose faults in software service processes and middleware, and outputs parsing results in combination with database configuration and corresponding parsing rules. The final parsing results are matched with the detection rules to output the final diagnostic results. The problem process can be located according to the detection results, and the operation log of this process can be downloaded for detailed analysis, thereby improving the efficiency and consistency of software service fault detection. In particular, when the scale of software services is large, the diagnostic results can be obtained quickly and accurately, thereby improving the operating safety of software services.
[0120] The technical solution provided by the embodiment of the present application can be applied to most software systems. Through some simple configurations, the software service can be monitored and detected. And through in-depth analysis of the monitoring details, it is possible to timely and accurately locate possible problems in the service process and middleware, including unreasonable resource use, concurrency conflicts, transaction anomalies, network connection problems, and potential security threats, and then take effective solutions to ensure the stable operation of the system, the security and reliability of data, and improve the quality and reliability of the entire software service. At the same time, the fault diagnosis service can run independently and basically will not affect the operation of other businesses.
[0121] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0122] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0123] Fig.11 Schematic diagram of a fault diagnosis device provided in an embodiment of the present application. Fig.11 As shown, the device comprises:
[0124] The acquisition module 1101 is configured to acquire fault diagnosis configuration information in response to receiving a fault diagnosis instruction, and determine a target diagnosis object based on the fault diagnosis configuration information, wherein the target diagnosis object includes a target service in a software service.
[0125] The display module 1102 is configured to call the object display instruction to display the running information of the software service.
[0126] The parsing module 1103 is configured to obtain preset parsing rules, parse the operation information based on the preset parsing rules, and obtain the parsed operation information of the target diagnosis object.
[0127] The diagnosis module 1104 is configured to obtain preset diagnosis rules, diagnose and analyze the parsed operation information based on the preset diagnosis rules, and obtain a fault diagnosis result of the software service.
[0128] According to the technical solution provided in the embodiment of the present application, by obtaining fault diagnosis configuration information when receiving a fault diagnosis instruction, determining the target diagnosis object based on the fault diagnosis configuration information, calling the object display instruction to display the operation information of the target diagnosis object, and parsing the operation information using preset parsing rules, and diagnosing the parsed operation information using preset diagnostic rules, automatic diagnosis of software service faults is achieved, the diagnosis efficiency and accuracy are improved, and there is no need to rely on the experience of software service operation and maintenance personnel, which ensures the consistency of fault diagnosis results and improves user experience.
[0129] In some implementations, obtaining fault diagnosis configuration information includes: obtaining pre-stored fault diagnosis configuration information from a preset database; or performing software service fault diagnosis configuration on a fault diagnosis page to obtain the fault diagnosis configuration information.
[0130] In some embodiments, the fault diagnosis configuration information includes at least one of the following: the process identifier, middleware identifier, middleware running port, configuration file, and running log path of the software service to be fault diagnosed; determining the target diagnosis object based on the fault diagnosis configuration information, including: obtaining the process identifier and middleware identifier in the fault diagnosis configuration information; determining the process corresponding to the process identifier and the middleware corresponding to the middleware identifier as the target diagnosis object.
[0131] In some embodiments, parsing the operation information based on preset parsing rules includes: obtaining the preset parsing rules; traversing the operation information, matching each piece of operation information with the preset parsing rules, and obtaining the parsed operation information of the target diagnostic object; wherein the parsed operation information includes at least one of the following: the process identifier of the target diagnostic object, the resource occupancy rate of the process of the target diagnostic object, the middleware identifier of the target diagnostic object, and the middleware operation port of the target diagnostic object.
[0132] In some embodiments, diagnosing the parsed operating information based on preset diagnostic rules includes: in response to determining that the parsed operating information does not include the process identifier of the target diagnosis object, determining that the diagnosis result of the software service is a fault; in response to determining that the parsed operating information includes the process identifier of the target diagnosis object, and the resource occupancy rate of the process of the target diagnosis object is greater than a preset threshold, determining that the diagnosis result of the software service is a fault; in response to determining that the parsed operating information does not include the middleware identifier of the target diagnosis object, determining that the diagnosis result of the software service is a fault; in response to determining that the parsed operating information includes the middleware identifier of the target diagnosis object, and the middleware operating port of the target diagnosis object in the operating information is different from the middleware operating port of the target diagnosis object in the fault diagnosis configuration information, determining that the diagnosis result of the software service is a fault.
[0133] In some embodiments, after obtaining the fault diagnosis result of the software service, it also includes: in response to determining that a fault exists based on the fault diagnosis result, obtaining the configuration file and operation log path of the software service corresponding to the fault from the configuration information; using the path information to obtain the operation log of the software service corresponding to the fault; and performing anomaly analysis based on the configuration file and the operation log.
[0134] In some implementations, the software service runs on a Linux operating system, and the object display instructions include top instructions and netstat instructions.
[0135] It should be understood that the size of the serial numbers of the steps in the above embodiments 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 the present application.
[0136] Fig.12 Schematic diagram of an electronic device provided in an embodiment of the present application. Fig.12 As shown, the electronic device 12 of this embodiment includes: a processor 1201, a memory 1202, and a computer program 1203 stored in the memory 1202 and executable on the processor 1201. When the processor 1201 executes the computer program 1203, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 1201 executes the computer program 1203, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0137] The electronic device 12 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 12 may include, but is not limited to, a processor 1201 and a memory 1202. Those skilled in the art will appreciate that Fig.12 The electronic device 12 is merely an example and does not limit the electronic device 12 , and may include more or fewer components than those shown in the figure, or different components.
[0138] Processor 1201 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0139] The memory 1202 may be an internal storage unit of the electronic device, for example, a hard disk or memory of the electronic device 12. The memory 1202 may also be an external storage device of the electronic device 12, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the electronic device 12. The memory 1202 may also include both an internal storage unit of the electronic device 12 and an external storage device. The memory 1202 is used to store computer programs and other programs and data required by the electronic device.
[0140] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated module / 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 present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0142] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A fault diagnosis method, characterized in that: The method is used to perform fault diagnosis on a software service, and the method comprises: In response to receiving a fault diagnosis instruction, acquiring fault diagnosis configuration information, and determining a target diagnosis object based on the fault diagnosis configuration information, wherein the target diagnosis object includes a target service in the software service; Calling an object display instruction to display the running information of the software service; Acquire a preset parsing rule, parse the operation information based on the preset parsing rule, and obtain the parsed operation information of the target diagnosis object; A preset diagnosis rule is obtained, and the parsed operation information is diagnosed based on the preset diagnosis rule to obtain a fault diagnosis result of the software service.
2. The method according to claim 1, characterized in that The obtaining of fault diagnosis configuration information includes: Obtaining pre-stored fault diagnosis configuration information from a preset database; or Perform software service fault diagnosis configuration on the fault diagnosis page to obtain the fault diagnosis configuration information.
3. The method according to claim 1 or 2, characterized in that: The fault diagnosis configuration information includes at least one of the following: The process ID, middleware ID, middleware operation port, configuration file and operation log path of the software service to be diagnosed; The determining a target diagnosis object based on the fault diagnosis configuration information includes: Obtaining the process identifier and the middleware identifier in the fault diagnosis configuration information; The process corresponding to the process identifier and the middleware corresponding to the middleware identifier are determined as the target diagnosis objects.
4. The method according to claim 1, characterized in that The parsing the operation information based on the preset parsing rule includes: Obtaining the preset parsing rule; Traversing the operation information, matching each piece of operation information with the preset parsing rule, and obtaining the parsed operation information of the target diagnosis object; The parsed operation information includes at least one of the following: The process identifier of the target diagnosis object, the resource occupancy rate of the process of the target diagnosis object, the middleware identifier of the target diagnosis object, and the middleware running port of the target diagnosis object.
5. The method according to claim 4, characterized in that The diagnosing the parsed operation information based on the preset diagnosis rule includes: In response to determining that the parsed operation information does not include the process identifier of the target diagnosis object, determining that the diagnosis result of the software service is that a fault exists; In response to determining that the parsed operation information includes the process identifier of the target diagnosis object, and the resource occupancy rate of the process of the target diagnosis object is greater than a preset threshold, determining that the diagnosis result of the software service is a fault; In response to determining that the parsed operation information does not include the middleware identifier of the target diagnosis object, determining that the diagnosis result of the software service is that a fault exists; In response to determining that the parsed operation information includes the middleware identifier of the target diagnosis object, and the middleware operation port of the target diagnosis object in the operation information is different from the middleware operation port of the target diagnosis object in the fault diagnosis configuration information, it is determined that the diagnosis result of the software service is a fault.
6. The method according to claim 1, characterized in that After obtaining the fault diagnosis result of the software service, the method further includes: In response to determining that a fault exists based on the fault diagnosis result, obtaining a configuration file and an operation log path of a software service corresponding to the fault from the configuration information; Using the path information, obtain the running log of the software service corresponding to the fault; Anomaly analysis is performed based on the configuration files and operation logs.
7. The method according to any one of claims 1 to 6, characterized in that The software service runs on a Linux operating system, and the object display instructions include top instructions and netstat instructions.
8. A fault diagnosis device, characterized in that: include: an acquisition module, configured to acquire fault diagnosis configuration information in response to receiving a fault diagnosis instruction, and determine a target diagnosis object based on the fault diagnosis configuration information, wherein the target diagnosis object includes a target service in the software service; A display module is configured to call an object display instruction to display the running information of the software service; A parsing module is configured to obtain a preset parsing rule, parse the operation information based on the preset parsing rule, and obtain the parsed operation information of the target diagnosis object; The diagnosis module is configured to obtain preset diagnosis rules, diagnose the parsed operation information based on the preset diagnosis rules, and obtain a fault diagnosis result of the software service.
9. An electronic 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 steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Server hardware link diagnosis method and system
CN121501556A