Fault location method, device and equipment
By obtaining the relationship map of the Internet technology system network cluster and determining the fault module and interface, the problem of low fault positioning efficiency caused by multi-layer association relationships is solved, and the effect of quickly locate the source fault nodes is achieved.
Patent Information
- Application Number
- CN202211399642.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-11-09
AI Technical Summary
In the Internet technology system network cluster, multi-layer association relationships lead to low fault positioning efficiency, and it is impossible to directly see the association relationship between multiple systems.
By obtaining the relationship maps of multiple systems, M fault modules and N fault interfaces are determined, and the source fault node is determined based on the relationship map, fault modules and fault interfaces.
Quickly locate the source fault node, improving the efficiency of fault location.
Smart Images

Figure CN115529229B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a fault location method, device, and equipment. Background Art
[0002] For any Internet Technology (IT) system network cluster, it may include multiple systems, which can process business through relevant associations and cooperation. During the process of business processing, if one of the systems fails, it may affect the normal operation of multiple associated systems, thus causing business processing abnormalities.
[0003] In the related art, a relational database can be used to record the system information corresponding to each system, the system information includes multiple modules included in each system, multiple interfaces provided by each module to the outside, and multiple interfaces called by each module; and a relational data table corresponding to each system is generated based on the system information; and then the association relationship between multiple systems is obtained based on the relationship data table between multiple systems, and the fault location analysis is performed on the faulty system based on the association relationship. In the above process, since each system can have multiple layers of association relationships, when performing fault location analysis on the faulty system based on the multi-layer association relationship, it is necessary to obtain the relationship data tables corresponding to multiple systems and it is impossible to directly see the association relationship between multiple systems, resulting in low efficiency in fault location. Summary of the invention
[0004] The embodiments of the present application provide a fault location method, apparatus and device, which can quickly locate the source fault node based on the traversal of the relationship graphs of multiple pre-built systems, thereby improving the efficiency of fault location.
[0005] In a first aspect, an embodiment of the present application provides a fault location method, the method comprising:
[0006] Obtain a relationship map of multiple systems, wherein the system includes multiple modules and interfaces provided by each module, and the relationship map includes interfaces provided by each module in each system, interfaces called by each module, functions of each module, and dependencies between each interface;
[0007] Determining M faulty modules and N faulty interfaces in a plurality of systems, where M and N are integers greater than or equal to 0;
[0008] According to the relationship graph, the M fault modules and the N fault interfaces, a source fault node is determined in the multiple systems, and the source fault node includes a source fault module and / or a source fault interface.
[0009] In a possible implementation manner, determining a source fault node in the multiple systems according to the relationship graph, the M fault modules, and the N fault interfaces includes:
[0010] Determine a result set according to the relationship graph and the M fault modules;
[0011] Determine an interface set according to the relationship graph, the M fault modules and the N fault interfaces, wherein the interface set includes at least one fault interface;
[0012] According to the relationship graph, the interface set and the result set are updated until the interface set is empty, and a module or an interface in the result set is determined as the source fault node.
[0013] In a possible implementation, determining a result set according to the relationship graph and the M fault modules includes:
[0014] Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1;
[0015] If it is determined according to the relationship graph that the i-th fault function does not call interfaces provided by other modules, or the fault of the i-th fault function is caused by the module where the i-th fault function is located, then the module where the i-th fault function is located is added to the result set;
[0016] Herein, the i is sequentially 1, 2, 3, ..., K until the result set is obtained.
[0017] In a possible implementation manner, determining an interface set according to the relationship graph, the M fault modules, and the N fault interfaces includes:
[0018] Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1;
[0019] If it is determined according to the relationship graph that the i-th fault function calls an interface provided by other modules, then the interface in a faulty state called by the i-th fault function is added to the interface set;
[0020] Herein, the i is sequentially 1, 2, 3, ..., K until the interface set is obtained.
[0021] In a possible implementation, updating the interface set and the result set according to the relationship graph until the interface set is empty, and determining a module or an interface in the result set as the source fault node includes:
[0022] Obtaining an i-th interface from the interface set, deleting the i-th interface from the interface set, and updating the result set or the interface set according to the relationship graph;
[0023] Wherein, the i is sequentially 1, 2, 3, ... until the interface set is empty, and a module or interface in the module set is determined as the source fault node.
[0024] In a possible implementation, updating the result set or the interface set according to the relationship graph includes:
[0025] If it is determined according to the relationship graph that the i-th interface does not depend on interfaces provided by other modules, or the failure of the i-th interface is caused by the module where the i-th interface is located, then the i-th interface and the module where the i-th interface is located are added to the result set;
[0026] If it is determined according to the relationship graph that the i-th interface depends on a candidate interface provided by other modules, and if the candidate interface is in a fault state, the candidate interface is added to the interface set.
[0027] In a possible implementation, obtaining a relationship graph of multiple systems includes:
[0028] If the relationship graph exists in the preset storage space, obtaining the relationship graph in the preset storage space;
[0029] If the relationship map does not exist in the preset storage space, the system information of each system in the multiple systems, the calling information between the multiple systems, and the dependency relationship between the interfaces are obtained, and the relationship map is generated based on the multiple system information, the calling information and the dependency relationship. The system information includes: module information of the modules in the system, interface information of the interfaces corresponding to the modules, and functional information of each module; the calling information includes information of the interfaces called by each module.
[0030] In a second aspect, an embodiment of the present application provides a fault location device, the device comprising an acquisition module and a determination module, wherein:
[0031] The acquisition module is used to acquire a relationship map of multiple systems, wherein the system includes multiple modules and interfaces provided by each module, and the relationship map includes interfaces provided by each module in each system, interfaces called by each module, functions of each module, and dependencies between each interface;
[0032] The determination module is used to determine M faulty modules and N faulty interfaces in multiple systems, where M and N are integers greater than or equal to 0;
[0033] The determination module is further used to determine a source fault node in the multiple systems according to the relationship graph, the M fault modules and the N fault interfaces, and the source fault node includes a source fault module and / or a source fault interface.
[0034] In a possible implementation manner, the determining module is specifically configured to:
[0035] Determine a result set according to the relationship graph and the M fault modules;
[0036] Determine an interface set according to the relationship graph, the M fault modules and the N fault interfaces, wherein the interface set includes at least one fault interface;
[0037] According to the relationship graph, the interface set and the result set are updated until the interface set is empty, and a module or an interface in the result set is determined as the source fault node.
[0038] In a possible implementation manner, the determining module is specifically configured to:
[0039] Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1;
[0040] If it is determined according to the relationship graph that the i-th fault function does not call interfaces provided by other modules, or the fault of the i-th fault function is caused by the module where the i-th fault function is located, then the module where the i-th fault function is located is added to the result set;
[0041] Herein, the i is sequentially 1, 2, 3, ..., K until the result set is obtained.
[0042] In a possible implementation manner, the determining module is further configured to:
[0043] Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1;
[0044] If it is determined according to the relationship graph that the i-th fault function calls an interface provided by other modules, then the interface in a faulty state called by the i-th fault function is added to the interface set;
[0045] Herein, the i is sequentially 1, 2, 3, ..., K until the interface set is obtained.
[0046] In a possible implementation manner, the determining module is further configured to:
[0047] Obtaining an i-th interface from the interface set, deleting the i-th interface from the interface set, and updating the result set or the interface set according to the relationship graph;
[0048] Wherein, the i is sequentially 1, 2, 3, ... until the interface set is empty, and a module or interface in the module set is determined as the source fault node.
[0049] In a possible implementation manner, the determining module is further configured to:
[0050] If it is determined according to the relationship graph that the i-th interface does not depend on interfaces provided by other modules, or the failure of the i-th interface is caused by the module where the i-th interface is located, then the i-th interface and the module where the i-th interface is located are added to the result set;
[0051] If it is determined according to the relationship graph that the i-th interface depends on a candidate interface provided by other modules, and if the candidate interface is in a fault state, the candidate interface is added to the interface set.
[0052] In a possible implementation manner, the acquisition module is specifically used to:
[0053] If the relationship graph exists in the preset storage space, obtaining the relationship graph in the preset storage space;
[0054] If the relationship map does not exist in the preset storage space, the system information of each system in the multiple systems, the calling information between the multiple systems, and the dependency relationship between the interfaces are obtained, and the relationship map is generated based on the multiple system information, the calling information and the dependency relationship. The system information includes: module information of the modules in the system, interface information of the interfaces corresponding to the modules, and functional information of each module; the calling information includes information of the interfaces called by each module.
[0055] In a third aspect, an embodiment of the present application provides a fault location device, including: a processor and a memory;
[0056] The memory is used to store computer programs;
[0057] The processor is used to execute the computer program stored in the memory to implement the method as described in any one of the first aspects.
[0058] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in any one of the first aspects.
[0059] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method described in any one of the first aspects.
[0060] The fault location method, device and equipment provided in the embodiment of the present application can obtain the relationship graph of multiple systems; and determine M fault modules and N fault interfaces in multiple systems; and then determine the source fault node in multiple systems based on the relationship graph, M fault modules and N fault interfaces. In the above process, the source fault node can be quickly located based on the M fault modules and N fault interfaces, and based on the traversal of the relationship graph of multiple systems built in advance, thereby improving the efficiency of fault location. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0062] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;
[0063] Figure 2 A schematic diagram of a flow chart of a fault location method provided in an embodiment of the present application;
[0064] Figure 3 A schematic diagram of a method for obtaining a relationship map provided in an embodiment of the present application;
[0065] Figure 4 A schematic diagram of a relationship map provided in an embodiment of the present application;
[0066] Figure 5 A flowchart of another fault location method provided in an embodiment of the present application;
[0067] Figure 6 A schematic diagram of the structure of a fault location device provided in an embodiment of the present application;
[0068] Figure 7 A schematic diagram of the hardware structure of the fault location device provided in an embodiment of the present application.
[0069] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0071] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 , including a fault location device 101, in which a determination module and a preset storage space are provided, and a relationship map is stored in the preset storage space.
[0072] The fault location device 101 can be used to obtain system fault information and determine the source fault node according to the system fault information. The specific processing process is as follows: the fault location device 101 can first obtain the system fault information through the determination device, and determine multiple fault modules and multiple fault interfaces in multiple systems according to the system fault information; then determine the source fault node in multiple systems according to the relationship map in the preset storage space, and multiple fault modules and multiple fault interfaces.
[0073] In the related art, a relational database can be used to record the system information corresponding to each system, the system information includes multiple modules included in each system, multiple interfaces provided by each module to the outside, and multiple interfaces called by each module; and a relational data table corresponding to each system is generated based on the system information; and then the association relationship between multiple systems is obtained based on the relationship data table between multiple systems, and the fault location analysis is performed on the faulty system based on the association relationship. In the above process, since each system can have multiple layers of association relationships, when performing fault location analysis on the faulty system based on the multi-layer association relationship, it is necessary to obtain the relationship data tables corresponding to multiple systems and it is impossible to directly see the association relationship between multiple systems, resulting in low efficiency in fault location.
[0074] In an embodiment of the present application, M fault modules and N fault interfaces can be determined in multiple systems based on multiple system fault information, and based on these M fault modules and N fault interfaces, and based on the traversal of the relationship graph of multiple pre-built systems, the source fault node can be quickly located, thereby improving the efficiency of fault locating.
[0075] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0076] Figure 2 A flowchart of a fault location method provided in an embodiment of the present application. Figure 2 , the method may include:
[0077] S201. Obtain a relationship graph of multiple systems.
[0078] The execution subject of the embodiment of the present application may be a fault location device, or a fault location apparatus provided in the fault location device. The fault location apparatus may be implemented by software, or by a combination of software and hardware.
[0079] The system may include multiple modules and interfaces provided by each module. The relationship graph includes the interfaces provided by each module in the system, the interfaces called by each module, the functions of each module, and the dependencies between the interfaces.
[0080] An interface is a service that a module opens to the outside world and can be called by other modules. A module can correspond to multiple interfaces, each of which is independent of each other and provides services to the outside world. An interface can be real-time, quasi-real-time, or non-real-time. For example, an online interface can be a real-time or quasi-real-time interface.
[0081] A module can have multiple functions. For example, a business management system module can have a user login function and various business management functions.
[0082] If interface A needs to rely on interface B to implement a certain function when in use, it indicates that there is a dependency relationship between interface A and interface B. This dependency relationship can be expressed as (interface A)-[dependency]->(interface B).
[0083] It should be noted that in Figure 3 In the illustrated embodiment, the process of obtaining a relationship graph of multiple systems is described in detail.
[0084] S202: Determine M faulty modules and N faulty interfaces in multiple systems.
[0085] Wherein, M and N are integers greater than or equal to 0.
[0086] For any module X, the module X can provide multiple interfaces and has multiple functions. If any function of the module X itself fails, or any interface fails, the module X is determined to be a faulty module. For example, when the server of module 1 crashes and the system cannot continue to work, and thus cannot implement a certain function, the module 1 is determined to be a faulty module. Optionally, if module 1 is a faulty module and the module ID corresponding to module 1 is 001, the faulty module can be represented as: (X: module 1 {module ID: 001}).
[0087] For any interface Y, if the response time of interface Y to a service request exceeds the agreed threshold during use, or the returned data format is wrong, then interface Y is determined to be a faulty interface. Optionally, if interface 1 is a faulty interface, and the interface ID corresponding to interface 1 is IF001, then the faulty interface can be represented as: (Y: interface 1 {interface ID: IF001}).
[0088] Optionally, the faulty module and faulty interface can be determined in the following manner: obtain multiple pieces of system fault information, where the system fault information may include the time when the fault occurred, the fault object and the fault cause, and the fault object may include the faulty module and / or the faulty interface; based on the multiple pieces of system fault information, determine M faulty modules and N faulty interfaces in multiple systems.
[0089] S203: Determine a source fault node in multiple systems according to the relationship graph, the M fault modules and the N fault interfaces.
[0090] The source fault node includes a source fault module and / or a source fault interface.
[0091] Optionally, the source fault node can be determined in the following manner: determine a result set based on the relationship graph and M fault modules; determine an interface set based on the relationship graph, M fault modules and N fault interfaces, the interface set including at least one fault interface; update the interface set and the result set according to the relationship graph until the interface set is empty, and determine the module or interface in the result set as the source fault node.
[0092] The fault location method provided in the embodiment of the present application can obtain the relationship graph of multiple systems; and determine M fault modules and N fault interfaces in multiple systems according to the system fault information; and then determine the source fault module in multiple systems according to the relationship graph, M fault modules and N fault interfaces. In the above process, the source fault module can be quickly located by obtaining the system fault information of the fault module and traversing the relationship graph of multiple systems built in advance, thereby improving the efficiency of locating the fault module.
[0093] Figure 3 A schematic diagram of a method for obtaining a relationship map provided in an embodiment of the present application. Figure 3 , the method may include:
[0094] S301, determine whether there is a relationship graph in the preset storage space.
[0095] If yes, execute S302;
[0096] If not, execute S303 to S306.
[0097] S302: Obtain a relationship graph in a preset storage space.
[0098] Optionally, the preset storage space may be a database. The database for storing the relationship graph in the present application may be selected according to actual conditions and is not limited here.
[0099] S303: Obtain system information of each system in the multiple systems.
[0100] The system information may include: module information of the modules in the system, interface information of the interfaces corresponding to the modules, and function information of each module. Optionally, the system information of each system in multiple systems may be obtained from source data of the IT system network, and the source data may be relational database data, text data, or other types of data.
[0101] The module information may include a module identification number (ID), a module name, and other descriptive information. The module information is illustrated below with reference to Table 1:
[0102] Table 1
[0103] Module ID Module Name Other explanatory information 001 Core trading system module Various account transaction functions 002 Online trading system module Online trading function 123 Credit Management System Module Credit process control function
[0104] The interface information may include the interface ID, the module ID, the interface name and other descriptive messages. The interface information is described below with reference to Table 2.
[0105] Table 2
[0106] Interface ID Module ID Interface Name Other explanatory information IF001 001 Query interface Check account IF002 002 Transfer interface Transfer Transaction
[0107] There is a providing relationship between modules and interfaces. Module A can provide interface B to other modules for calling, that is, A provides B. This providing relationship can be expressed as (module A)-[provides]->(interface B).
[0108] For example, referring to Table 2, for module 001, it can provide interface IF001 to the outside to realize the function of querying the account, that is, module 001 provides interface IF001, which can be expressed as (module 001)-[provide]->(interface IF001).
[0109] The function information may include a function ID, a module ID, a function name, and other descriptive messages. The function information is described below with reference to Table 3.
[0110] Table 3
[0111] Function ID Module ID Function Name Other explanatory information F001 001 Download file function Download Profile F002 002 Login Functionality User login
[0112] There is an ownership relationship between modules and functions. Module A can have function B, that is, module A owns function B. This ownership relationship can be expressed as (module A)-[owns]->(function B).
[0113] For example, referring to Table 3, for module 001, it may have function F001, that is, module 001 has function F001, which is expressed as (module 001)-[has]->(function F001).
[0114] S304: Obtain call information between multiple systems.
[0115] The calling information may include information about the interface called by each module. The calling information may be reflected by function information of the function possessed by each module and interface information used by the function.
[0116] If interface C is needed to implement function B, it indicates that there is a corresponding relationship between function B and interface C, which can be called a consumption relationship. That is, function B consumes interface C, which is expressed as (function B)-[consumption]->(interface C).
[0117] The consumption relationship between any function and the multiple interfaces consumed by the function can be determined by acquiring the consumption relationship information corresponding to the function. Optionally, the consumption relationship information may include the function ID, the interface ID consumed by the function and other descriptive information.
[0118] For example, the consumption relationship information can be shown in the following table:
[0119] Table 4
[0120] Function ID The ID of the interface consumed by the function Other explanatory information F001 IF003 none F002 IF004 none F003 IF003 none
[0121] Please refer to Table 4. For example, for function F001, it needs to use interface IF003 when implementing it, that is, function F001 consumes interface IF003, which can be expressed as (function F001)-[consumption]->(interface IF003).
[0122] S305: Obtain the dependency relationship between the interfaces.
[0123] The dependency relationship between any interface and the multiple interfaces on which the interface depends can be determined by acquiring the dependency relationship information corresponding to any interface. Optionally, the dependency relationship information may include the interface ID, the dependent interface ID and other descriptive information.
[0124] For example, the dependency information can be shown in the following table:
[0125] Table 5
[0126] Interface ID Dependent interface ID Other explanatory information IF001 IF003 none IF002 IF004 none
[0127] Please refer to Table 5. For example, for interface IF001, it needs to rely on interface IF003 to implement the query function when used, that is, interface IF001 depends on interface IF003, which can be expressed as (interface IF001)-[dependency]->(interface IF003).
[0128] S305: Generate a relationship graph based on multiple system information, call information and dependency relationships.
[0129] The relationship graph may include multiple systems, interfaces provided by modules in each system, interfaces called by modules, functions of modules, and dependencies between interfaces.
[0130] Next, combine Figure 4 , explain the generated relationship graph.
[0131] Figure 4 A schematic diagram of a relationship map provided in an embodiment of the present application. Figure 4 , the relationship diagram contains two systems, namely system 1 and system 2.
[0132] System 1 includes two modules, namely module 001 and module 002. Module 001 can provide interface IF001, and module 1 has function F001; module 002 can provide interface IF002, and module 2 has function F002. System 2 includes two modules, namely module 003 and module 004. Module 002 can provide interface IF003, and module 1 has function F003; module 004 can provide interface IF004, and module 2 has function F004.
[0133] exist Figure 4In the relationship diagram shown, each module can be represented as a module node, each interface can be represented as an interface node, and each function can be represented as a function node. These nodes can be used to represent and store entity data, and each node should have a unique identification attribute. For example, a module node can be used to represent and store module information corresponding to the module, and the identifier of the module node can be the module ID corresponding to the module.
[0134] See also Figure 4 , module nodes and interface nodes, module nodes and function nodes, function nodes and interface nodes, and different interface nodes can be connected by directional connection lines. In the relationship graph, each directional connection line can represent a directed edge, which can be used to represent the provision relationship between module nodes and interface nodes, the ownership relationship between module nodes and function nodes, the consumption relationship between function nodes and interface nodes, and the dependency relationship between interface nodes. For example, the directed edge from module 001 to interface IF001 can be used to represent the provision relationship between module 001 and interface IF001; the directed edge from module 001 to function F001 can be used to represent the ownership relationship between module 001 and function F001; the directed edge from function F001 to interface IF003 can be used to represent the consumption relationship between function F001 and interface IF003; the directed edge from interface IF001 to interface IF003 can be used to represent the dependency relationship between interface IF001 and interface IF003.
[0135] S306: Store the generated relationship graph in a preset storage space.
[0136] The method for obtaining a relationship map provided in an embodiment of the present application can obtain system information of each system in multiple systems, call information between multiple systems, and dependencies between interfaces, and generate a relationship map based on multiple system information, call information, and dependencies. Through the relationship map, the corresponding relationship between systems, functions, modules, and interfaces, as well as the association relationship between each module node and each interface node can be clearly seen, thereby facilitating the subsequent tracking and positioning of multiple fault nodes with association relationships.
[0137] Next, combine Figure 5 , the fault location method provided in the embodiment of the present application is described in detail.
[0138] Figure 5 A flowchart of another fault location method provided in an embodiment of the present application. Figure 5 , the method may include:
[0139] S501. Determine M faulty modules and N faulty interfaces in multiple systems.
[0140] Wherein, M and N are integers greater than or equal to 0.
[0141] It should be noted that the execution process of S501 can refer to the execution process of S202, which will not be described in detail here.
[0142] S502: Determine K fault functions among M fault modules.
[0143] Wherein, K is an integer greater than or equal to 1.
[0144] Optionally, a fault module may correspond to one or more fault functions. For any fault module X, the set of fault functions corresponding to the fault module X can be represented as {Y i |Fault module X-[has]->Function Y i And function Y i Fault}, where Y i is any fault function corresponding to the fault module X, and i is 1, 2, 3, ..., K in sequence.
[0145] S503. If it is determined according to the relationship graph that the i-th fault function does not call the interface provided by other modules, or the fault of the i-th fault function is caused by the module where the i-th fault function is located, then the module where the i-th fault function is located is added to the result set.
[0146] The result set may include both faulty modules and faulty interfaces.
[0147] Optionally, before executing step S503, it is necessary to first obtain the relationship map in the preset storage space. For the specific execution process of obtaining the relationship map, refer to Figure 3 The steps in the embodiment are executed.
[0148] If it is determined according to the relationship graph that the i-th fault function does not call the interface provided by other modules, then the module where the i-th fault function is located can be determined as the fault module and added to the result set. For example, see Figure 4 As shown in the relationship diagram, it is assumed that function F003 is a faulty function. Since function F003 does not call interfaces provided by other modules, module 003 where function F003 is located can be determined as a faulty module and added to the result set.
[0149] If the fault of the i-th fault function is caused by the module where the i-th fault function is located, then the module where the i-th fault function is located can be determined as the faulty module and added to the result set. For example, see Figure 4As shown in the relationship diagram, assuming that module 001 fails, function F001 will fail. At this time, module 001 can be determined as a faulty module and added to the result set.
[0150] Optionally, step S503 may be repeatedly performed, with i being 1, 2, 3, ..., K in sequence, until a result set is obtained.
[0151] S504: If it is determined according to the relationship graph that the i-th fault function calls an interface provided by other modules, the interface in a faulty state called by the i-th fault function is added to the interface set.
[0152] The interface set includes at least one faulty interface.
[0153] For example, see Figure 4 As shown in the relationship diagram, it is assumed that function F002 is a fault function, and there is a consumption relationship between function F002 and interface IF004, indicating that when function F002 is implemented, interface IF004 provided by module 004 needs to be called. Then, when interface IF004 is in a faulty state, interface IF004 can be added to the interface collection.
[0154] Optionally, step S504 may be repeatedly performed, with i being 1, 2, 3, ..., K in sequence, until an interface set is obtained.
[0155] S505: Obtain the i-th interface in the interface set, and delete the i-th interface in the interface set.
[0156] Optionally, after obtaining the interface set, the i-th interface in the interface combination can be selected as the current interface, the interface node corresponding to the i-th interface can be found in the relationship graph, the relationship graph can be traversed in turn by the interface node, and the i-th interface can be deleted from the interface set.
[0157] After obtaining the i-th interface, the result set and the interface set may be updated according to the relationship graph. For specific execution methods, see S506 to S507.
[0158] S506. If it is determined according to the relationship graph that the i-th interface does not depend on interfaces provided by other modules, or the failure of the i-th interface is caused by the module where the i-th interface is located, then the i-th interface and the module where the i-th interface is located are added to the result set.
[0159] If it is determined according to the relationship graph that the i-th interface does not depend on interfaces provided by other modules, then the i-th interface can be determined as a faulty interface, the module where the i-th interface is located can be determined as a faulty module, and the i-th interface and the module where the i-th interface is located can be added to the result set. For example, see Figure 4As shown in the relationship diagram, assuming that the i-th interface is interface IF003, since interface IF003 does not depend on interfaces provided by other modules, interface IF003 can be confirmed as a faulty interface, module 003 where interface IF003 is located can be determined as a faulty module, and interface IF003 and module 003 can be added to the result set.
[0160] If the fault of the i-th interface is caused by the module where the i-th interface is located, then the i-th interface can be determined as a faulty interface, the module where the i-th interface is located can be determined as a faulty module, and the i-th interface and the module where the i-th interface is located can be added to the result set. For example, see Figure 4 As shown in the relationship diagram, assuming that module 001 fails, interface IF001 will fail. At this time, interface IF001 can be determined as a faulty interface, module 001 can be determined as a faulty module, and interface IF001 and module 001 can be added to the result set.
[0161] S507: If it is determined according to the relationship graph that the i-th interface depends on a candidate interface provided by other modules, and if the candidate interface is in a fault state, the candidate interface is added to the interface set.
[0162] If the interface to be selected is not in a faulty state, return to reselect the next interface of the i-th interface in the interface set, repeat steps S505 to S507, i is 1, 2, 3, ... in sequence, until the interface set is empty, and the module or interface in the module set is determined as the source fault node.
[0163] For example, see Figure 4 As shown in the relationship diagram, it is assumed that the i-th interface is interface IF001, and there is a dependency relationship between interface IF001 and interface IF003 provided by module 003, then interface IF003 can be regarded as a candidate interface; determine whether interface IF003 is in a faulty state, if interface IF003 is in a faulty state, indicating that interface IF003 is a faulty interface, and interface IF003 can be added to the interface set; if interface IF003 is not in a faulty state, return to reselect the next interface of the i-th interface in the interface set, and repeat steps S505 to S507, i takes 1, 2, 3, ... in sequence, until the interface set is empty, and the module or interface in the module set is determined as the source fault node.
[0164] The fault location method provided in the embodiment of the present application can determine M fault modules and N fault interfaces in multiple systems according to multiple system fault information, and based on these M fault modules and N fault interfaces, and based on the traversal of the relationship graph of multiple pre-built systems, quickly locate the source fault node, thereby improving the efficiency of fault location.
[0165] Figure 6 A schematic diagram of the structure of a fault location device provided in an embodiment of the present application. Figure 6 The fault location device 10 includes an acquisition module 11 and a determination module 12, wherein:
[0166] The acquisition module 11 is used to acquire a relationship map of multiple systems, wherein the system includes multiple modules and interfaces provided by each module, and the relationship map includes interfaces provided by each module in each system, interfaces called by each module, functions of each module, and dependencies between each interface;
[0167] The determination module 12 is used to determine M faulty modules and N faulty interfaces in multiple systems, where M and N are integers greater than or equal to 0;
[0168] The determination module 12 is further used to determine a source fault node in the multiple systems according to the relationship graph, the M fault modules and the N fault interfaces, wherein the source fault node includes a source fault module and / or a source fault interface.
[0169] The fault location device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0170] Optionally, the determining module 12 is specifically configured to:
[0171] Determine a result set according to the relationship graph and the M fault modules;
[0172] Determine an interface set according to the relationship graph, the M fault modules and the N fault interfaces, wherein the interface set includes at least one fault interface;
[0173] According to the relationship graph, the interface set and the result set are updated until the interface set is empty, and a module or an interface in the result set is determined as the source fault node.
[0174] Optionally, the determining module 12 is specifically configured to:
[0175] Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1;
[0176] If it is determined according to the relationship graph that the i-th fault function does not call interfaces provided by other modules, or the fault of the i-th fault function is caused by the module where the i-th fault function is located, then the module where the i-th fault function is located is added to the result set;
[0177] Herein, the i is sequentially 1, 2, 3, ..., K until the result set is obtained.
[0178] Optionally, the determining module 12 is further configured to:
[0179] Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1;
[0180] If it is determined according to the relationship graph that the i-th fault function calls an interface provided by other modules, then the interface in a faulty state called by the i-th fault function is added to the interface set;
[0181] Herein, the i is sequentially 1, 2, 3, ..., K until the interface set is obtained.
[0182] Optionally, the determining module 12 is further configured to:
[0183] Obtaining an i-th interface from the interface set, deleting the i-th interface from the interface set, and updating the result set or the interface set according to the relationship graph;
[0184] Wherein, the i is sequentially 1, 2, 3, ... until the interface set is empty, and a module or interface in the module set is determined as the source fault node.
[0185] Optionally, the determining module 12 is further configured to:
[0186] If it is determined according to the relationship graph that the i-th interface does not depend on interfaces provided by other modules, or the failure of the i-th interface is caused by the module where the i-th interface is located, then the i-th interface and the module where the i-th interface is located are added to the result set;
[0187] If it is determined according to the relationship graph that the i-th interface depends on a candidate interface provided by other modules, and if the candidate interface is in a fault state, the candidate interface is added to the interface set.
[0188] Optionally, the acquisition module 11 is specifically used for:
[0189] If the relationship graph exists in the preset storage space, obtaining the relationship graph in the preset storage space;
[0190] If the relationship map does not exist in the preset storage space, the system information of each system in the multiple systems, the calling information between the multiple systems, and the dependency relationship between the interfaces are obtained, and the relationship map is generated based on the multiple system information, the calling information and the dependency relationship. The system information includes: module information of the modules in the system, interface information of the interfaces corresponding to the modules, and functional information of each module; the calling information includes information of the interfaces called by each module.
[0191] Figure 7 This is a schematic diagram of the hardware structure of the fault location device provided in the embodiment of the present application. Figure 7 The fault location device 20 may include a processor 21 and a memory 22 . The processor 21 and the memory 22 may communicate with each other; illustratively, the processor 21 and the memory 22 communicate with each other via a communication bus 23 .
[0192] The memory 22 is used to store computer-executable instructions;
[0193] The processor 21 is used to execute the computer-executable instructions stored in the memory 22, so that the processor 21 executes the fault location method shown in the above method embodiment.
[0194] Optionally, the fault location device 20 may further include a communication interface, which may include a transmitter and / or a receiver.
[0195] Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0196] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the fault location method described in the above method embodiment.
[0197] An embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, a computer executes the above-mentioned fault location method.
[0198] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.
[0199] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0200] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0201] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.
[0202] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A fault location method, characterized in that: include: Obtain a relationship map of multiple systems, wherein the system includes multiple modules and interfaces provided by each module, and the relationship map includes interfaces provided by each module in each system, interfaces called by each module, functions of each module, and dependencies between each interface; Determining M faulty modules and N faulty interfaces in a plurality of systems, where M and N are integers greater than or equal to 0; Determine a source fault node in the multiple systems according to the relationship graph, the M fault modules and the N fault interfaces, the source fault node including a source fault module and / or a source fault interface; Determining a source fault node in the multiple systems according to the relationship graph, the M fault modules, and the N fault interfaces includes: Determine a result set according to the relationship graph and the M fault modules, wherein the result set includes at least one fault module; Determine an interface set according to the relationship graph, the M fault modules and the N fault interfaces, wherein the interface set includes at least one fault interface; According to the relationship graph, the interface set and the result set are updated until the interface set is empty, and a module or an interface in the result set is determined as the source fault node; Determining a result set according to the relationship graph and the M fault modules includes: Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1; If it is determined according to the relationship graph that the i-th fault function does not call interfaces provided by other modules, or the fault of the i-th fault function is caused by the module where the i-th fault function is located, then the module where the i-th fault function is located is added to the result set; Wherein, the i is 1, 2, 3, ..., K in sequence until the result set is obtained; Determining an interface set according to the relationship graph, the M fault modules, and the N fault interfaces includes: Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1; If it is determined according to the relationship graph that the i-th fault function calls an interface provided by other modules, then the interface in a faulty state called by the i-th fault function is added to the interface set; Herein, the i is sequentially 1, 2, 3, ..., K until the interface set is obtained.
2. The method according to claim 1, characterized in that According to the relationship graph, updating the interface set and the result set until the interface set is empty, and determining a module or an interface in the result set as the source fault node, including: Obtaining an i-th interface from the interface set, deleting the i-th interface from the interface set, and updating the result set or the interface set according to the relationship graph; Wherein, the i is sequentially 1, 2, 3, ... until the interface set is empty, and a module or interface in the module set is determined as the source fault node.
3. The method according to claim 2, characterized in that According to the relationship graph, updating the result set or the interface set includes: If it is determined according to the relationship graph that the i-th interface does not depend on interfaces provided by other modules, or the failure of the i-th interface is caused by the module where the i-th interface is located, then the i-th interface and the module where the i-th interface is located are added to the result set; If it is determined according to the relationship graph that the i-th interface depends on a candidate interface provided by other modules, and if the candidate interface is in a fault state, the candidate interface is added to the interface set.
4. The method according to any one of claims 1 to 3, characterized in that: Get a relationship map of multiple systems, including: If the relationship graph exists in the preset storage space, obtaining the relationship graph in the preset storage space; If the relationship map does not exist in the preset storage space, the system information of each system in the multiple systems, the calling information between the multiple systems, and the dependency relationship between the interfaces are obtained, and the relationship map is generated based on the multiple system information, the calling information and the dependency relationship. The system information includes: module information of the modules in the system, interface information of the interfaces corresponding to the modules, and functional information of each module; the calling information includes information of the interfaces called by each module.
5. A fault location device, characterized in that: The device comprises: an acquisition module and a determination module, wherein: The acquisition module is used to acquire a relationship map of multiple systems, wherein the system includes multiple modules and interfaces provided by each module, and the relationship map includes interfaces provided by each module in each system, interfaces called by each module, functions of each module, and dependencies between each interface; The determination module is used to determine M faulty modules and N faulty interfaces in multiple systems, where M and N are integers greater than or equal to 0; The determination module is further used to determine a source fault node in the multiple systems according to the relationship graph, the M fault modules and the N fault interfaces, wherein the source fault node includes a source fault module and / or a source fault interface; When determining a source fault node in the multiple systems according to the relationship graph, the M fault modules and the N fault interfaces, the determining module is specifically used to: Determine a result set according to the relationship graph and the M fault modules, wherein the result set includes at least one fault module; Determine an interface set according to the relationship graph, the M fault modules and the N fault interfaces, wherein the interface set includes at least one fault interface; According to the relationship graph, the interface set and the result set are updated until the interface set is empty, and a module or an interface in the result set is determined as the source fault node; Determining a result set according to the relationship graph and the M fault modules includes: Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1; If it is determined according to the relationship graph that the i-th fault function does not call interfaces provided by other modules, or the fault of the i-th fault function is caused by the module where the i-th fault function is located, then the module where the i-th fault function is located is added to the result set; Wherein, the i is 1, 2, 3, ..., K in sequence until the result set is obtained; Determining an interface set according to the relationship graph, the M fault modules, and the N fault interfaces includes: Determine K fault functions among the M fault modules, where K is an integer greater than or equal to 1; If it is determined according to the relationship graph that the i-th fault function calls an interface provided by other modules, then the interface in a faulty state called by the i-th fault function is added to the interface set; Here, the i is sequentially 1, 2, 3, ..., K until the interface set is obtained.
6. A fault location device, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory to implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: in, The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Fault data analysis method and device of data system
CN114090449A