Fault positioning method and device, equipment and storage medium

By using bytecode instrumentation technology to obtain database operation information and send it to the distributed link tracking system, the problem of low fault location accuracy caused by the lack of execution information in full-link tracking technology is solved, and efficient fault location is achieved.

CN120803783APending Publication Date: 2025-10-17CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510916858.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing full-link tracing technology lacks execution information when processing database operations, resulting in low fault location accuracy, high troubleshooting difficulty and time cost.

Method used

The business identification information of database operation requests is collected through bytecode instrumentation technology to obtain detailed database operation information, and then it and the execution result information are sent to the distributed link tracking system for fault location.

Benefits of technology

The accuracy and efficiency of fault location are improved, and the difficulty and time cost of troubleshooting are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803783A_ABST
    Figure CN120803783A_ABST
Patent Text Reader

Abstract

The invention discloses a fault positioning method and device, equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps: responding to a database operation request triggered based on a target database, and obtaining service identification information corresponding to the database operation request; collecting database operation information corresponding to the database operation request based on the service identification information through a byte code instrumentation technology; determining execution result information corresponding to the database operation request; and sending the execution result information and the database operation information to a distributed link tracking system for fault positioning. According to the method, the database operation information corresponding to the database operation request can be acquired through a byte code instrumentation technology, and the execution result information of the request and the database operation information are sent to the distributed link tracking system for fault positioning; the technical problem of low fault positioning precision caused by lack of execution information of a database in a defect positioning method based on a full-link tracking technology in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and particularly relates to a fault positioning method and device, equipment and a storage medium. BACKGROUND

[0002] With the rapid development of information technology, modern business systems are becoming increasingly complex, and higher requirements are placed on the reliability and stability of the systems. As an important means of fault positioning and performance monitoring, full-link tracking technology has gradually become an indispensable part of business systems. Full-link tracking technology records and analyzes the interaction process between various components in the system, helping developers quickly locate problems, optimize performance, and providing an overall view of the system.

[0003] However, the existing full-link tracking technology has obvious deficiencies in processing the execution information of middleware (such as databases), for example, for database operations, the existing technology can usually only provide limited execution information, so that when facing link exceptions related to databases, the difficulty and time cost of troubleshooting are high, and the fault positioning accuracy is not high. SUMMARY

[0004] The main purpose of the present application is to provide a fault positioning method, device, equipment and storage medium, which aims to solve the technical problem that the defect positioning method based on the full-link tracking technology in the prior art lacks execution information of the database, resulting in low fault positioning accuracy.

[0005] To achieve the above purpose, the present application provides a fault positioning method, which comprises:

[0006] In response to a database operation request triggered based on a target database, and obtaining business identification information corresponding to the database operation request;

[0007] Collecting database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology;

[0008] Determining execution result information corresponding to the database operation request;

[0009] Sending the execution result information and the database operation information to a distributed link tracking system, so that the distributed link tracking system performs fault positioning based on the database operation information and the execution result information.

[0010] In an embodiment, the step of collecting database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology comprises:

[0011] The preset query statement setting method is enhanced by a bytecode plug-in technology to obtain a target query statement setting method;

[0012] The target query statement setting method is intercepted based on the business identification information by the bytecode plug-in technology to collect database operation information corresponding to the database operation request.

[0013] In an embodiment, the step of intercepting the target query statement setting method based on the business identification information by the bytecode plug-in technology to collect database operation information corresponding to the database operation request comprises:

[0014] The target query statement setting method is intercepted based on the business identification information by the bytecode plug-in technology;

[0015] Execution information acquisition code is inserted at an entry position and an exit position of the intercepted target query statement setting method;

[0016] The execution information acquisition code is used to collect a precompiled statement corresponding to a query statement in the database operation request and an execution start time corresponding to the query statement.

[0017] The database operation information corresponding to the database operation request is generated based on the precompiled statement and the execution start time.

[0018] In an embodiment, before the step of generating the database operation information corresponding to the database operation request based on the precompiled statement and the execution start time, the method further comprises:

[0019] The precompiled statement is subjected to sensitive field desensitization processing to generate a desensitized precompiled statement;

[0020] The precompiled statement is replaced by the desensitized precompiled statement.

[0021] In an embodiment, after the step of intercepting the target query statement setting method based on the business identification information by the bytecode plug-in technology to collect the database operation information corresponding to the database operation request, the method further comprises:

[0022] Link information corresponding to the database operation request is parsed to obtain link identification information corresponding to the database operation request;

[0023] It is judged whether the link identification information exists in an associated target link recorder;

[0024] If the link identification information exists in the associated target link recorder, the database operation information is written into the target link recorder;

[0025] The step of sending the execution result information and the database operation information to the distributed link tracking system comprises:

[0026] The execution result information and the database operation information stored in the target link recorder are sent to the distributed link tracking system.

[0027] In an embodiment, before the step of collecting the database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology, the method further comprises:

[0028] The link information corresponding to the database operation request is parsed;

[0029] It is judged whether the link information exists in the database operation request according to the parsing result;

[0030] If the link information exists, a link recorder is created based on the link identification information in the link information, and the link recorder is a storage mechanism based on thread local variable.

[0031] In an embodiment, the step of determining the execution result information corresponding to the database operation request comprises:

[0032] The statement execution object and the statement execution time corresponding to the target query statement in the database operation request are determined;

[0033] It is judged whether the target query statement is executed successfully, and the statement execution result corresponding to the target query statement is obtained according to the judgment result;

[0034] The execution result information corresponding to the database operation request is determined based on the statement execution object, the statement execution time and the statement execution result.

[0035] In addition, in order to achieve the above-mentioned purpose, the application further provides a fault positioning device, which comprises:

[0036] A request response module is configured to respond to a database operation request triggered based on a target database and obtain business identification information corresponding to the database operation request;

[0037] An information collection module is configured to collect database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology;

[0038] An information determination module is configured to determine execution result information corresponding to the database operation request;

[0039] A fault locating module is configured to send the execution result information and the database operation information to a distributed link tracking system, so that the distributed link tracking system performs fault locating based on the database operation information and the execution result information.

[0040] In addition, to achieve the above object, the application further provides a fault locating device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the fault locating method as described above.

[0041] In addition, to achieve the above object, the application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the fault locating method as described above.

[0042] The application provides a fault locating method, and the application discloses the following steps: responding to a database operation request triggered based on a target database, and obtaining business identification information corresponding to the database operation request; collecting database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology; determining execution result information corresponding to the database operation request; sending the execution result information and the database operation information to a distributed link tracking system, so that the distributed link tracking system performs fault locating based on the database operation information and the execution result information; compared with the full-link tracking technology in the prior art, which can only provide limited execution information in processing the database operation, the difficulty and time cost of fault locating are high, and the fault locating precision is not high. Since the application can collect the corresponding database operation information based on the business identification information corresponding to the database operation request through bytecode instrumentation technology, and send the execution result information and the database operation information of the request to the distributed link tracking system for fault locating, the technical problem that the fault locating precision is not high due to the lack of execution information of the database in the defect locating method based on the full-link tracking technology in the prior art is solved. BRIEF DESCRIPTION OF DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and serve to explain the principles of the application together with the specification.

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without creative labor.

[0045] Figure 1A flowchart provided by the first embodiment of the fault locating method of the present application;

[0046] Figure 2 A flowchart for collecting execution information in the fault locating method of the present application;

[0047] Figure 3 A system architecture diagram of the fault locating method of the present application;

[0048] Figure 4 A flowchart provided by the second embodiment of the fault locating method of the present application;

[0049] Figure 5 A flowchart provided by the third embodiment of the fault locating method of the present application;

[0050] Figure 6 A flowchart for aggregating service logs in the fault locating method of the present application;

[0051] Figure 7 A flowchart for initializing a link recorder in the fault locating method of the present application;

[0052] Figure 8 A module structure diagram of the fault locating device of the embodiment of the present application;

[0053] Figure 9 A device structure diagram of the hardware running environment involved in the fault locating method of the embodiment of the present application.

[0054] The object, function features and advantages of the present application will be further explained with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0055] It should be understood that the specific embodiments described herein are merely intended to explain the technical solutions of the present application, and are not intended to limit the present application.

[0056] In order to better understand the technical solutions of the present application, the following will be described in detail in combination with the accompanying drawings and specific embodiments.

[0057] The main solution of the embodiment of the present application is: in response to a database operation request triggered based on a target database, obtaining service identification information corresponding to the database operation request; collecting database operation information corresponding to the database operation request based on the service identification information through bytecode instrumentation technology; determining execution result information corresponding to the database operation request; sending the execution result information and the database operation information to a distributed link tracking system, so that the distributed link tracking system performs fault locating based on the database operation information and the execution result information.

[0058] Since the full-link tracking technology in the prior art can only provide limited execution information in processing database operations, the difficulty and time cost of troubleshooting are high, and the fault positioning accuracy is not high.

[0059] The present application provides a solution, which can collect corresponding database operation information based on the business identification information corresponding to the database operation request through bytecode instrumentation technology, and send the execution result information and the database operation information of the request to the distributed link tracking system for fault positioning, thereby solving the technical problem that the defect positioning method based on the full-link tracking technology in the prior art lacks database execution information, resulting in low fault positioning accuracy.

[0060] It should be noted that the execution subject of the present embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a fault positioning device, and a fault positioning system containing the fault positioning device, etc. The present embodiment and the following embodiments will be described below taking the fault positioning system as an example (hereinafter referred to as the system).

[0061] Based on this, the present application provides a fault positioning method, which is described with reference to Figure 1 , Figure 1 is a flowchart of the first embodiment of the fault positioning method of the present application.

[0062] In the present embodiment, the fault positioning method comprises steps S10-S40:

[0063] Step S10: in response to a database operation request triggered based on a target database, and obtaining the business identification information corresponding to the database operation request.

[0064] It should be understood that the above-mentioned target database can be a database executing the database operation request, and in the present embodiment, the target database can be any SQL-supported database management system, such as MySQL, PostgreSQL, Oracle, SQL Server, etc., and the present embodiment does not limit this.

[0065] It should be noted that the above database operation request can be a request for operating the database, which can include but is not limited to query (SELECT), insert (INSERT), update (UPDATE) and delete (DELETE). In actual application, the database operation request can be executed through a database access framework (such as Hibernate) or directly using JDBC (Java Database Connectivity). For example, when user information needs to be queried, the system can initiate a SQL query request, which is a database operation request.

[0066] It should be noted that the above business identification information can be business context information related to the database operation request, and in actual application, the business identification information can be used to identify and track specific business operations. In this embodiment, the business identification information can include a business primary key and a business node name, wherein the business primary key is a key value for uniquely identifying a database operation, such as an order ID, a user ID, etc.; and the business node name is a node or module to which the database operation belongs, such as "user management", "order processing", etc.

[0067] In specific implementation, a user can perform operations in a target database according to business requirements to generate corresponding database operation requests, at which time the system responds to the database operation requests, and when the database operation requests enter a business node, the system can analyze the database operation requests to obtain business identification information in the database operation requests, including a business primary key and a business node name.

[0068] Step S20: Collecting database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology.

[0069] It should be noted that the above bytecode instrumentation technology can be a technology for enhancing program behavior by dynamically modifying Java bytecode files (.class files) without modifying source code.

[0070] It should be understood that the above database operation information can be detailed information related to the database operation request, such as a SQL statement, an execution start time, etc., wherein the SQL statement is an executed SQL statement text; and the execution start time is a start time of the execution of the SQL statement.

[0071] In the embodiment, the system can enhance the setSqlTxt method (i.e., the query statement setting method) of the StatementPreparerImpl class in the Hibernate framework through the bytecode instrumentation technology, so as to collect the database operation information related to the business identification information. The setSqlTxt method can be a method for setting the SQL statement text content in the Hibernate framework.

[0072] Step S30: determining the execution result information corresponding to the database operation request.

[0073] It can be understood that the above execution result information can be result information for indicating whether the execution of the SQL statement is successful. In the embodiment, the system can realize the automatic interception and monitoring of the SQL statement by enhancing the setSqlTxt method of the StatementPreparerImpl class, so as to obtain the execution result information corresponding to the database operation request.

[0074] Specifically, the step S30 includes: determining the statement execution object and the statement execution time consumption corresponding to the target query statement in the database operation request; judging whether the target query statement is executed successfully, and obtaining the statement execution result corresponding to the target query statement according to the judgment result; and determining the execution result information corresponding to the database operation request based on the statement execution object, the statement execution time consumption and the statement execution result.

[0075] It should be understood that the above target query statement can be a SQL (Structured Query Language, structured query language) command for retrieving data from a database. In practical applications, data can be retrieved from one or more tables of a target database through the target query statement, and the results can be filtered and sorted according to specified conditions.

[0076] It can be understood that the above statement execution object can be an object for executing a SQL statement, for example, PreparedStatement, Statement, etc., and the embodiment does not limit this; and the above statement execution time can be the time consumed for executing the SQL statement. In actual application, in the Hibernate framework, the statement execution object is usually managed by the internal mechanism of Hibernate, and the embodiment can obtain and parse these statement execution objects by inserting code in the setSqlTxt method through bytecode instrumentation technology. In addition, the statement execution time can be calculated by the start time and the end time of the setSqlTxt method call. Specifically, the embodiment can record the start time at the entry position of the setSqlTxt method and record the end time at the exit position of the setSqlTxt method, and then calculate the difference between the two to obtain the statement execution time.

[0077] It should be noted that for judging whether the SQL statement execution is successful or not, the embodiment can check the return value or exception at the exit position of the setSqlTxt method. If the method returns normally, it is considered that the SQL statement execution is successful; if an exception is thrown, it is considered that the SQL statement execution fails, and finally the statement execution result is obtained. Finally, the system can integrate the statement execution object, the statement execution time and the statement execution result to generate the execution result information corresponding to the database operation request.

[0078] In specific implementation, refer to Figure 2 , Figure 2 for the flowchart of collecting execution information in the fault locating method of the present application. As shown in Figure 2 , after detecting that the database operation request enters the business node aspect, the system can initialize the SQL recorder based on the thread local variable, aggregate the SQL precompilation information, then parse and identify the execution object of the SQL statement, calculate the time consumed for executing the SQL statement and whether the execution is successful or not, and finally send these execution information to the distributed link system for subsequent fault locating and statistical analysis by the distributed link system, and finally the request leaves the business node.

[0079] Step S40: sending the execution result information and the database operation information to the distributed link tracking system, so that the distributed link tracking system performs fault locating based on the database operation information and the execution result information.

[0080] In actual application, refer to Figure 3 , Figure 3 for the system architecture diagram of the fault locating method of the present application. As shown in Figure 3As shown, the embodiment can first enhance the setSqlTxt method of the StatementPreparerImpl class through bytecode instrumentation technology, thereby realizing automatic interception and monitoring of SQL statements to collect SQL execution information corresponding to database operation requests. These information can be recorded in thread local variables and ultimately sent to the full link tracking platform, so that the full link tracking platform can perform fault location and performance monitoring based on database operation information and execution result information. Compared with the hard coding method, the present application does not invade the business code and only needs to simply introduce the dependency to quickly connect.

[0081] The embodiment provides a fault location method. The method discloses responding to a database operation request triggered based on a target database, and obtaining business identification information corresponding to the database operation request. Database operation information corresponding to the database operation request is collected based on the business identification information through bytecode instrumentation technology. Execution result information corresponding to the database operation request is determined. The execution result information and the database operation information are sent to a distributed link tracking system, so that the distributed link tracking system performs fault location based on the database operation information and the execution result information. Compared with the full link tracking technology in the prior art, which can only provide limited execution information when processing database operations, the difficulty and time cost of fault troubleshooting are high, and the fault location accuracy is not high. Since the embodiment can collect the corresponding database operation information based on the business identification information corresponding to the database operation request through bytecode instrumentation technology, and send the execution result information and the database operation information of the request to the distributed link tracking system for fault location, the technical problem of low fault location accuracy caused by the lack of database execution information in the prior art defect positioning method based on the full link tracking technology is solved.

[0082] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as the above embodiment one can refer to the above introduction, and will not be described in detail. On this basis, please refer to Figure 4 , Figure 4 The flowchart provided for the second embodiment of the fault location method of the present application.

[0083] In the embodiment, step S20 includes steps S201-S202:

[0084] Step S201: The preset query statement setting method is enhanced by bytecode instrumentation technology, and a target query statement setting method is obtained.

[0085] It should be understood that the above preset query statement setting method, i.e., the setSqlTxt method, can be used to set the text content of the SQL statement. In actual application, when Hibernate performs a database operation, the system can set the precompiled SQL statement into the Statement object through the setSqlTxt method, and the embodiment can realize the interception and monitoring of the SQL statement by enhancing this setSqlTxt method, so as to collect the relevant information of the SQL execution for fault positioning and full-link tracking.

[0086] Step S202: Intercepting the target query statement setting method based on the business identification information through the bytecode instrumentation technology to collect the database operation information corresponding to the database operation request.

[0087] Specifically, the step S202 includes: intercepting the target query statement setting method based on the business identification information through the bytecode instrumentation technology; inserting an execution information acquisition code at the entry position and the exit position of the intercepted target query statement setting method; collecting the precompiled statement corresponding to the query statement in the database operation request and the execution start time corresponding to the query statement through the execution information acquisition code; and generating the database operation information corresponding to the database operation request based on the precompiled statement and the execution start time.

[0088] In actual application, the system can first load the target class StatementPreparerImpl to obtain the instance of the setSqlTxt method, and insert the self-defined code based on the bytecode instrumentation technology to record the precompilation information of the SQL statement. Meanwhile, the code is inserted at the entry position of the setSqlTxt method to record the link information (such as the link uniqueness identification) of the current request, and the code is inserted at the exit position of the setSqlTxt method to calculate the execution time of the method. Finally, the precompilation information, the execution object, the execution time consumption, and whether the execution is successful of the SQL statement are obtained. Then, these information can be integrated to obtain the database operation information corresponding to the database operation request.

[0089] Further, before the step of generating the database operation information corresponding to the database operation request based on the precompiled statement and the execution start time, the method further includes: performing sensitive field desensitization processing on the precompiled statement to generate a desensitized precompiled statement; and replacing the precompiled statement with the desensitized precompiled statement.

[0090] It should be noted that the embodiment can perform sensitive field desensitization processing on the collected SQL precompiled statement to desensitize the sensitive customer information in the SQL precompiled statement, so as to avoid the leakage of sensitive information and improve the security of the data.

[0091] In this embodiment, the preset query statement setting method is enhanced by bytecode instrumentation technology to obtain a target query statement setting method; the target query statement setting method is intercepted based on business identification information by bytecode instrumentation technology to collect database operation information corresponding to the database operation request; since the preset query statement setting method is enhanced by bytecode instrumentation technology in this embodiment, and the enhanced target query statement setting method is intercepted to collect detailed database operation information, the SQL statement can be quickly intercepted and accurately positioned, which is beneficial to improve the accuracy of subsequent fault positioning.

[0092] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as the above embodiments can be referred to the above introduction, and the following will not be repeated. On this basis, please refer to Figure 5 , Figure 5 The flowchart provided for the third embodiment of the fault positioning method of the present application.

[0093] In this embodiment, after step S202, the method further includes steps S203-S205:

[0094] Step S203: The link information corresponding to the database operation request is parsed to obtain the link identification information corresponding to the database operation request.

[0095] It should be understood that the above link identification information can be information for uniquely identifying the flow path of the database operation request in the system, which can include a global identifier (such as traceId) and a local identifier (such as spanId), wherein the global identifier can be a globally unique identifier for identifying the complete path of the database operation request, and the local identifier can be an identifier for identifying the processing process of the request in a certain service. The specific structure of the link identification information is not limited in this embodiment. In actual application, the system can track the flow path (such as the call relationship) of the database operation request between various services according to the link identification information corresponding to the database operation request in a complex distributed system, thereby helping developers understand the processing flow of the request. In addition, when a fault occurs, the link identification information can help quickly locate the source of the problem, and find the specific service or code segment that causes the problem by tracking the path of the request.

[0096] In this embodiment, when the database operation request enters the system, the system can parse the database operation request to obtain the link information carried in the request, and parse the link information to obtain the link identification information corresponding to the database operation request.

[0097] Step S204: judging whether the link identification information exists associated target link recorder.

[0098] It should be noted that the above target link recorder can be a tool for recording database operation information related to the database operation request. In the embodiment, the target link recorder can be implemented based on ThreadLocal to ensure that each thread can independently record and manage its own database operation information in a multi-thread environment, avoiding data confusion. In the embodiment, the target link recorder can collect and store SQL execution information related to the current database operation request, including SQL statement, execution object, execution time consumption, success or not, and other key information, so as to subsequently send the execution information to the full link tracking system for fault positioning. In addition, the embodiment can associate the database operation information with the link identification information (such as traceId and spanId) of the database operation request through the link recorder, thereby realizing full link tracking.

[0099] Step S205: if the database operation information exists, writing the database operation information into the target link recorder.

[0100] In the embodiment, after the system parses the corresponding link identification information from the link information of the database operation request, it can detect whether there is a link recorder associated with the current link identification information in the ThreadLocal. If there is, the link recorder is determined as the target link recorder. In addition, if there is no link recorder associated with the current link identification information, a new link recorder can be created at this time, and it is associated with the current link identification information to obtain the target link recorder, and the database operation information is recorded using the target link recorder.

[0101] In specific implementation, referring to Figure 6 , Figure 6 is a flow diagram of the method for fault positioning in the present application. As shown in Figure 6 , in the embodiment, the business code can access the database through the hibernate framework, and intercept the setSqlTxt method in the StatementPreparerImpl class through the bytecode plug-in mode to collect the specific information of SQL execution, then parse the link information of the database operation request, obtain the link identification information corresponding to the database operation request, and retrieve whether there is a SQL recorder associated with the link identification information. If there is, the precompiled statement of the SQL and the execution start time and other execution information can be written into the corresponding SQL recorder.

[0102] Correspondingly, the step S40 includes:

[0103] Step S41: Send the execution result information and the database operation information stored in the target link recorder to the distributed link tracking system.

[0104] Furthermore, before step S20, it also includes: parsing the link information corresponding to the database operation request; judging whether there is link information in the database operation request based on the parsing result; if so, creating a link recorder based on the link identification information in the link information, and the link recorder is a storage mechanism based on thread local variables.

[0105] In the specific implementation, refer to Figure 7 , Figure 7 This is a flow chart of initializing the link recorder in the fault location method of this application. Figure 7 As shown, after detecting that a database operation request enters a business node, the system can initialize the SQL recorder. Specifically, it can first parse the link information of the database operation request and determine whether the link information is currently obtained. If it is successfully obtained, a SQL recorder based on thread local variables can be created based on the link identification information in the link information.

[0106] In this embodiment, it is disclosed to parse the link information corresponding to the database operation request to obtain the link identification information corresponding to the database operation request; determine whether there is an associated target link recorder for the link identification information; if so, write the database operation information into the target link recorder; send the execution result information and the database operation information stored in the target link recorder to the distributed link tracking system; because this embodiment can store the database operation information corresponding to the database operation request through the target link recorder, and send the database operation information to the distributed link tracking system for fault location, it can improve the maintainability and security of the system, while reducing development and maintenance costs.

[0107] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the fault location method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0108] This application also provides a fault location device, please refer to Figure 8 , the fault locating device comprises:

[0109] The request response module 10 is used to respond to a database operation request triggered by a target database and obtain service identification information corresponding to the database operation request;

[0110] An information collection module 20 is configured to collect database operation information corresponding to the database operation request based on the business identification information using a bytecode instrumentation technology;

[0111] The information determining module 30 is configured to determine execution result information corresponding to the database operation request;

[0112] The fault locating module 40 is configured to send the execution result information and the database operation information to a distributed link tracking system, so that the distributed link tracking system performs fault locating based on the database operation information and the execution result information.

[0113] The fault locating apparatus provided in the present application adopts the fault locating method in the above embodiments, and can solve the technical problem that the fault locating precision is not high due to the lack of execution information of a database in the defect locating method based on the full link tracking technology in the prior art. Compared with the prior art, the fault locating apparatus provided in the present application has the same beneficial effects as the fault locating method provided in the above embodiments, and other technical features in the fault locating apparatus are the same as the features disclosed in the above embodiments, which will not be repeated here.

[0114] The present application provides a fault locating device, which comprises at least one processor and a memory connected with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the fault locating method in the above embodiment one.

[0115] Reference will be made to the following description Figure 9 which shows a structural diagram of a fault locating device suitable for implementing the embodiments of the present application. The fault locating device in the embodiments of the present application can include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 9 The fault locating device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0116] As Figure 9As shown, the fault locating device can include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to programs stored in a read-only memory 1002 or loaded from a storage device 1003 into a random access memory 1004. Various programs and data required for operation of the fault locating device are also stored in the random access memory 1004. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other by a bus 1005. An input / output interface 1006 is also connected to the bus. Generally, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the fault locating device to communicate with other devices wirelessly or by wire to exchange data. Although the fault locating device with various systems is shown in the figure, it should be understood that all the shown systems are not required to be implemented or possessed. More or less systems can be alternatively implemented or possessed.

[0117] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by a communication device, or installed from the storage device 1003, or installed from the read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.

[0118] The fault locating device provided by the present application adopts the fault locating method in the above-mentioned embodiments, and can solve the technical problem of fault locating. Compared with the prior art, the fault locating device provided by the present application has the same beneficial effects as the fault locating method provided by the above-mentioned embodiments, and other technical features in the fault locating device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0119] It should be understood that parts of the present disclosure can be realized by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0120] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which shall be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

[0121] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer programs) for performing the fault locating method in the above embodiments.

[0122] The computer readable storage medium provided by the present application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection having one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), an optical fiber, a portable compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), etc., or any suitable combination thereof.

[0123] The above computer readable storage medium can be contained in the fault locating device; or can exist separately without being assembled into the fault locating device.

[0124] The above computer readable storage medium carries one or more programs, which, when executed by the fault locating device, cause the fault locating device to: in response to a database operation request triggered based on a target database, acquire service identification information corresponding to the database operation request; collect database operation information corresponding to the database operation request based on the service identification information through bytecode instrumentation technology; determine execution result information corresponding to the database operation request; and send the execution result information and the database operation information to a distributed link tracking system, so that the distributed link tracking system performs fault locating based on the database operation information and the execution result information.

[0125] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0126] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0127] The modules involved in the embodiments of the present application can be implemented in the form of software or hardware. In some cases, the name of the module does not constitute a limitation on the module itself.

[0128] The readable storage medium provided by the application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer programs) for executing the above fault locating method, and can solve the technical problem that the defect locating method based on the full link tracking technology in the prior art lacks the execution information of the database, resulting in low fault locating accuracy. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the application are the same as those of the fault locating method provided by the above-mentioned embodiments, and will not be repeated here.

[0129] The above-mentioned is only part of the embodiments of the application, and does not limit the patent scope of the application. Any equivalent structural transformation, direct / indirect application in other related technical fields based on the technical concept of the application, and the contents of the specification and drawings are included in the patent protection scope of the application.

Claims

1. A fault location method, characterized in that: The method includes: Responding to a database operation request triggered by a target database and obtaining service identification information corresponding to the database operation request; Collecting database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology; Determining execution result information corresponding to the database operation request; The execution result information and the database operation information are sent to a distributed link tracking system, so that the distributed link tracking system performs fault location based on the database operation information and the execution result information.

2. The method according to claim 1, wherein The step of collecting the database operation information corresponding to the database operation request based on the business identification information by using the bytecode instrumentation technology includes: Enhance the preset query statement setting method through bytecode instrumentation technology to obtain the target query statement setting method; The target query statement setting method is intercepted based on the business identification information through the bytecode instrumentation technology to collect database operation information corresponding to the database operation request.

3. The method according to claim 2, wherein The step of intercepting the target query statement setting method based on the business identification information by using the bytecode instrumentation technology to collect database operation information corresponding to the database operation request includes: Intercepting the target query statement setting method based on the business identification information by using the bytecode instrumentation technology; Insert execution information acquisition code at the entry and exit positions of the intercepted target query statement setting method; Collecting, through the execution information acquisition code, a precompiled statement corresponding to the query statement in the database operation request and an execution start time corresponding to the query statement; Database operation information corresponding to the database operation request is generated based on the prepared statement and the execution start time.

4. The method according to claim 3, wherein Before the step of generating the database operation information corresponding to the database operation request based on the prepared statement and the execution start time, the method further includes: Desensitizing sensitive fields of the precompiled statement to generate a desensitized precompiled statement; The precompiled statement is replaced by the desensitized precompiled statement.

5. The method according to claim 2, wherein After the step of intercepting the target query statement setting method based on the business identification information by using the bytecode instrumentation technology to collect database operation information corresponding to the database operation request, the method further includes: Parsing the link information corresponding to the database operation request to obtain link identification information corresponding to the database operation request; Determining whether the link identification information has an associated target link recorder; If so, writing the database operation information into the target link recorder; The step of sending the execution result information and the database operation information to the distributed link tracking system includes: The execution result information and the database operation information stored in the target link recorder are sent to a distributed link tracking system.

6. The method according to claim 2, wherein Before the step of collecting the database operation information corresponding to the database operation request based on the business identification information by using the bytecode instrumentation technology, the method further includes: Parsing the link information corresponding to the database operation request; Determining whether link information exists in the database operation request according to the analysis result; If it exists, a link recorder is created based on the link identification information in the link information, where the link recorder is a storage mechanism based on thread local variables.

7. The method according to any one of claims 1 to 6, characterized in that The step of determining the execution result information corresponding to the database operation request includes: Determine the statement execution object and statement execution time corresponding to the target query statement in the database operation request; Determine whether the target query statement is executed successfully, and obtain the statement execution result corresponding to the target query statement according to the determination result; Execution result information corresponding to the database operation request is determined based on the statement execution object, the statement execution time, and the statement execution result.

8. A fault location device, characterized in that: The device comprises: A request response module, configured to respond to a database operation request triggered based on a target database and obtain service identification information corresponding to the database operation request; An information collection module, configured to collect database operation information corresponding to the database operation request based on the business identification information through bytecode instrumentation technology; An information determination module, configured to determine execution result information corresponding to the database operation request; The fault location module is used to send the execution result information and the database operation information to the distributed link tracking system, so that the distributed link tracking system performs fault location based on the database operation information and the execution result information.

9. A fault location device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the fault location method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the fault location method according to any one of claims 1 to 7 are implemented.