A data processing method and related apparatus

By adding transaction information to the Mybatis logs and filtering environment information using regular expressions, the problem of complex SQL statement debugging was solved, and executable and easy-to-debug SQL statement output was achieved.

CN115599805BActive Publication Date: 2026-07-03AGRICULTURAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRICULTURAL BANK OF CHINA
Filing Date
2022-10-27
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

When using Mybatis for debugging in existing technologies, the readability of SQL statements is poor, the call chain cannot be traced, and existing tools are often paid, highly intrusive, and unable to print transaction information corresponding to SQL statements, resulting in a complex debugging process.

Method used

By obtaining the initial log of the SQL statement, the print class is modified to add transaction information, and environment information is filtered using regular expressions to output the executable SQL statement.

Benefits of technology

The debugging process has been simplified, making the SQL statements executable and containing transaction information, which facilitates debugging and avoids performance loss and source code intrusion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115599805B_ABST
    Figure CN115599805B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method and related apparatus. The method obtains the initial log corresponding to an SQL statement, modifies the print class of the initial log to add transaction information corresponding to the SQL statement to the print class, thus obtaining a transaction log. Simultaneously, regular expressions are used to restore the transaction log, filtering environment information from the SQL statement and outputting an executable SQL statement. Since the presence of environment information prevents direct printing of the SQL statement from being executable and thus unusable for debugging, filtering the environment information using regular expressions makes the filtered SQL statement executable after printing, achieving the purpose of restoring the SQL statement. By modifying the print class of the initial log to include transaction information corresponding to the SQL statement, this transaction information represents the transaction entry point of the SQL statement. Because of the added transaction information, subsequent debugging can be directly performed using the executable SQL statement, simplifying the debugging process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method and related apparatus. Background Technology

[0002] Mybatis is an open-source Java persistence framework that uses XML descriptors or annotations to associate objects with stored procedures or SQL statements, mapping them to corresponding records in the database.

[0003] In a local integrated development environment (IDE) using Mybatis, SQL statements that need to be executed are typically logged for debugging and tracing. However, directly printed SQL statements are not directly executable, have poor readability, and cannot be traced through the call chain. Related technologies include using the Mybatis Log Plugin (an IntelliJ IDEA plugin) and its platform JAR package to filter console output and reconstruct SQL statements; or using a JDBC monitoring framework like p6spy to wrap critical JDBC classes, allowing the application system to call the wrapper class to intercept SQL statements, reconstruct them, and then output the reconstructed SQL statements, making them executable after printing.

[0004] However, Mybatis Log Plugin is a paid plugin, while p6spy requires adding the p6spy field to the JDBC URL, which presents problems such as uncontrollability and strong intrusion into the source code. Furthermore, neither of them can print the transaction information corresponding to the SQL statement, making the debugging process based on SQL statements complicated. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a data processing method and related apparatus that can simplify the debugging process.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On one hand, embodiments of this application provide a data processing method, the method comprising:

[0008] Retrieve the initial log corresponding to the SQL statement;

[0009] Modify the print class corresponding to the initial log, and add the transaction information corresponding to the SQL statement to the print class to obtain the transaction log;

[0010] The transaction log is restored using regular expressions, the environment information in the SQL statement is filtered out, and an executable SQL statement is output.

[0011] In one possible implementation, modifying the print class corresponding to the initial log by adding the transaction information corresponding to the SQL statement to the print class to obtain the transaction log includes:

[0012] The transaction information is added to the print class by modifying the print class using Javaassit, thus obtaining the transaction log.

[0013] In one possible implementation, the process of restoring the transaction log using regular expressions, filtering environment information in the SQL statement, and outputting an executable SQL statement includes:

[0014] The regular expression is used to split and assemble the Preparing, Parameters, and Total statements corresponding to the transaction log to filter the environment information and obtain the initial SQL statement corresponding to the SQL statement.

[0015] The initial SQL statement is formatted to obtain a standard SQL statement;

[0016] Obtain the transaction information from the transaction log;

[0017] The transaction information is added to the header of the standard SQL statement to obtain the executable SQL statement.

[0018] In one possible implementation, the method further includes:

[0019] Execute the executable SQL statement and obtain the execution result;

[0020] Obtain the transaction result corresponding to the transaction information;

[0021] The executable SQL statement is debugged based on the difference between the execution result and the transaction result.

[0022] In one possible implementation, the transaction information includes an entry transaction code and a transaction version.

[0023] In one possible implementation, the initial log and the transaction log are Mybatis logs.

[0024] On the other hand, embodiments of this application provide a data processing apparatus, the apparatus including an acquisition unit, a modification unit, and an output unit:

[0025] The acquisition unit is used to acquire the initial log corresponding to the SQL statement;

[0026] The modification unit is used to modify the print class corresponding to the initial log, and add the transaction information corresponding to the SQL statement to the print class to obtain the transaction log;

[0027] The output unit is used to restore the transaction log using regular expressions, filter the environment information in the SQL statement, and output an executable SQL statement.

[0028] In one possible implementation, the modification unit is further configured to:

[0029] The transaction information is added to the print class by modifying the print class using Javaassit, thus obtaining the transaction log.

[0030] In one possible implementation, the output unit is further used for:

[0031] The regular expression is used to split and assemble the Preparing, Parameters, and Total statements corresponding to the transaction log to filter the environment information and obtain the initial SQL statement corresponding to the SQL statement.

[0032] The initial SQL statement is formatted to obtain a standard SQL statement;

[0033] Obtain the transaction information from the transaction log;

[0034] The transaction information is added to the header of the standard SQL statement to obtain the executable SQL statement.

[0035] In one possible implementation, the device further includes an execution unit and a debugging unit:

[0036] The execution unit is used to execute the executable SQL statement and obtain the execution result;

[0037] The acquisition unit is also used to acquire the transaction result corresponding to the transaction information;

[0038] The debugging unit is used to debug the executable SQL statement based on the difference between the execution result and the transaction result.

[0039] In one possible implementation, the transaction information includes an entry transaction code and a transaction version.

[0040] In one possible implementation, the initial log and the transaction log are Mybatis logs.

[0041] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory:

[0042] The memory is used to store program code and transmit the program code to the processor;

[0043] The processor is used to execute the data processing method described above according to the instructions in the program code.

[0044] In another aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the data processing method described above.

[0045] In another aspect, embodiments of this application provide a computer program product including instructions that, when run on a computer, cause the computer to perform the data processing method described above.

[0046] As can be seen from the above technical solution, the initial log corresponding to the SQL statement is obtained, and the print class corresponding to the initial log is modified to add the transaction information corresponding to the SQL statement to the print class, thus obtaining the transaction log. The transaction information represents the transaction entry point corresponding to the SQL statement; therefore, adding it to the print class ensures that the transaction log has the transaction entry point corresponding to the SQL statement compared to the initial log, facilitating debugging using the SQL statement. Simultaneously, regular expressions are used to restore the transaction log, filtering environment information in the SQL statement and outputting an executable SQL statement. Environment information refers to interference information included in the SQL statement. The presence of environment information prevents the SQL statement from being executed directly after printing, thus making it unusable for debugging. Therefore, filtering the environment information using regular expressions ensures that the filtered SQL statement is executable after printing. Compared to debugging methods in related technologies, this application first modifies the print class of the initial log corresponding to the SQL statement to include the transaction information corresponding to the SQL statement in the transaction log, and simultaneously filters the environment information in the SQL statement, achieving the purpose of restoring the SQL statement. Because transaction information is added, subsequent debugging can be directly performed using the executable SQL statement, simplifying the debugging process. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0049] Figure 2 A schematic diagram of a Mybatis log printing class provided in an embodiment of this application;

[0050] Figure 3a This is a schematic diagram of an insertion statement provided in an embodiment of this application;

[0051] Figure 3b This is a schematic diagram of a query statement provided in an embodiment of this application;

[0052] Figure 3c This is a schematic diagram of an output statement provided in an embodiment of this application;

[0053] Figure 4 A schematic diagram of a data processing method provided in an embodiment of this application;

[0054] Figure 5 This is a structural diagram of a data processing apparatus provided in an embodiment of this application. Detailed Implementation

[0055] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0056] The data processing method provided in this application can be implemented using a computer device, which can be a terminal device or a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitations in this regard.

[0057] The following examples illustrate this in detail:

[0058] Figure 1 A flowchart of a data processing method provided in this application embodiment, using a server as an example of the aforementioned computer device, is used for illustration. The method includes S101-S103:

[0059] S101: Retrieve the initial log corresponding to the SQL statement.

[0060] When developing with Mybatis in a local integrated development environment, you can first obtain the initial logs corresponding to the SQL statements. These SQL statements can be native SQL statements used for debugging, such as transaction SQL statements. The initial logs can be Mybatis-based logs, meaning they can be Mybatis logs.

[0061] S102: Modify the print class corresponding to the initial log, add the transaction information corresponding to the SQL statement to the print class, and obtain the transaction log.

[0062] When developing with Mybatis, you can refer to the native logs printed by Mybatis. Figure 3a and Figure 3b As shown, where, Figure 3a A schematic diagram of an insert statement is shown. Figure 3b The diagram illustrates a query statement. Specifically, the first line of the executed statement begins with "Preparing," the second line with parameters begins with "Parameters," and the third line with the number of affected rows begins with "Updates," "Total," etc. This makes the statement difficult to read and cannot be executed directly. Furthermore, different operation types (insert, select, etc.) are not color-coded, do not conform to formatting standards, and the transaction information for this SQL statement is unknown. Therefore, it is impossible to locate and investigate the source and actual impact of this SQL statement.

[0063] Therefore, to facilitate debugging, the print class corresponding to the initial log can be modified first. Based on the modification, the transaction information corresponding to the SQL statement can be added to the print class to obtain the transaction log. The transaction information represents the transaction entry point corresponding to the SQL statement; therefore, adding it to the print class ensures that the transaction log has the transaction entry point corresponding to the SQL statement compared to the initial log. This facilitates debugging using the SQL statement, allowing for direct location and investigation of the source of the SQL statement during debugging. Generally, the transaction information can include the entry transaction code and the transaction version.

[0064] When using the Mybatis framework, there are a total of five logging classes under org.apache.ibatis.logging.jdbc. See [link / reference] for details. Figure 2 As shown, these are BaseJdbcLogger, PreparedStatementLogger, StatementLogger, ConnectionLogger, and ResultSetLogger, respectively. Figure 2The interface InvocationHandler is also shown. BaseJdbcLogger is the main class, and the other four are subclasses. All four subclasses use dynamic proxies to proxy the object that actually executes the SQL statement, printing the executed statement, execution parameters, and the number of rows returned before and after execution.

[0065] Based on this, one possible implementation is to modify the print class using Javaassit to add transaction information, thus obtaining the transaction log. Specifically, Javaassit can be used to add the ability to retrieve the transaction information corresponding to the SQL statement to the debug method called in the invoke method of the four subclasses mentioned above, and output it along with the actual SQL statement to obtain the transaction log. In practical applications, the project can also be packaged into a JAR file, and then the application can be started with the parameter -javaagent= / path / agent.jar. This will print the transaction log containing specific transaction information such as the entry transaction code and transaction version when outputting Mybatis logs. It can be understood that the transaction log obtained in this way can be a Mybatis type log, that is, the transaction log can be a Mybatis log.

[0066] In one possible implementation, the transaction information corresponding to the SQL statement can be obtained through a transaction thread. Specifically, the entry transaction code and transaction version in the transaction thread can be retrieved.

[0067] S103: Use regular expressions to restore transaction logs, filter environment information in SQL statements, and output executable SQL statements.

[0068] The environmental information refers to the interfering information included in the SQL statement. The presence of this environmental information renders the SQL statement unexecutable after direct printing, thus preventing debugging. Therefore, regular expressions can be used to restore the transaction log. By filtering the environmental information in the SQL statement through regular expressions, an executable SQL statement is finally output. Because filtering the environmental information using regular expressions ensures that the resulting SQL statement does not contain it, it is executable after printing, achieving the goal of restoring the SQL statement.

[0069] In one possible implementation, regular expressions can be used to split and assemble the Preparing, Parameters, and Total statements corresponding to the transaction log to filter environment information, obtain the initial SQL statement corresponding to the SQL statement, and then format the initial SQL statement to obtain the standard SQL statement. Transaction information is then obtained from the transaction log and added to the header of the standard SQL statement to obtain the executable SQL statement.

[0070] Specifically, when using regular expressions to restore transaction logs, there are basically four types of operations: add, delete, modify, and query. Based on these four operation types, the Preparing, Parameters, and Total statements can be split and reassembled to filter environment information and obtain the initial SQL statement. Since this splitting and reassembly is performed, the initial SQL statement can be formatted to ensure its executability, resulting in a standard SQL statement. The standard SQL statement is executable. Because transaction information represents the transaction entry point corresponding to the SQL statement, in practical applications, the transaction information can be added to the header of the standard SQL statement to obtain the final executable SQL statement. It is understandable that since the transaction log contains transaction information, this information can be directly obtained from the transaction log.

[0071] In one possible implementation, corresponding marker colors can be set for the four different operation types. In actual operation, the code font color can be changed to the marker color corresponding to the operation type for different operation types. Based on this, the code lines of the final output executable SQL statement have different colors, achieving the purpose of color differentiation, so that debugging engineers can view them.

[0072] See Figure 3c This is a schematic diagram of an output statement provided in an embodiment of this application. It should be noted that... Figure 3c Only a portion of the executable SQL statements are shown.

[0073] In one possible implementation, after the executable SQL statement is output through the above processing, it can be executed to obtain the execution result and the corresponding transaction result. Then, based on the difference between the execution result and the transaction result, the executable SQL statement can be debugged. Here, the transaction result can refer to the standard transaction data corresponding to the current transaction information, while the execution result refers to the pending transaction data corresponding to the current transaction information obtained by running the executable SQL statement. Therefore, the difference between the execution result and the transaction result indicates the correctness of the executable SQL statement. Thus, in actual debugging, the executable SQL statement can be debugged based on the difference between the execution result and the transaction result to facilitate debugging and obtain an executable SQL statement that can be directly applied to transaction processing.

[0074] As can be seen from the above technical solution, the initial log corresponding to the SQL statement is obtained, and the print class corresponding to the initial log is modified to add the transaction information corresponding to the SQL statement to the print class, thus obtaining the transaction log. The transaction information represents the transaction entry point corresponding to the SQL statement; therefore, adding it to the print class ensures that the transaction log has the transaction entry point corresponding to the SQL statement compared to the initial log, facilitating debugging using the SQL statement. Simultaneously, regular expressions are used to restore the transaction log, filtering environment information in the SQL statement and outputting an executable SQL statement. Environment information refers to interference information included in the SQL statement. The presence of environment information prevents the SQL statement from being executed directly after printing, thus making it unusable for debugging. Therefore, filtering the environment information using regular expressions ensures that the filtered SQL statement is executable after printing. Compared to debugging methods in related technologies, this application first modifies the print class of the initial log corresponding to the SQL statement to include the transaction information corresponding to the SQL statement in the transaction log, and simultaneously filters the environment information in the SQL statement, achieving the purpose of restoring the SQL statement. Because transaction information is added, subsequent debugging can be directly performed using the executable SQL statement, simplifying the debugging process.

[0075] This application leverages Java language features and the Mybatis framework to restore native Mybatis logs, enabling the restored SQL statements to be directly executed in the database. These restored SQL statements are the aforementioned executable SQL statements. Compared to Mybatis Log Plugins in related technologies, the method provided in this application eliminates the need to purchase plugins, avoiding performance overhead. Furthermore, compared to p6spy in related technologies, the method provided in this application is non-intrusive to the source code and offers enhanced security.

[0076] Figure 4This is a schematic diagram illustrating a data processing method provided in an embodiment of this application. Specifically, the initial log can be started by adding the `-javaagent` parameter, thereby modifying the print class of the initial log to add transaction information, including the entry transaction code and transaction version. Then, Mybatis is used to output transaction logs containing the entry transaction code and transaction version. Further, the transaction logs output by Mybatis are restored to filter out environment information in the SQL statements, achieving the purpose of restoring the SQL statements. In practical applications, for ease of debugging, executable SQL statements with color, conforming to formatting requirements, and containing the entry transaction code and transaction version can be output.

[0077] It is understood that this basically corresponds to the method embodiment, so relevant details can be found in the description of the method embodiment.

[0078] Figure 5 This is a structural diagram of a data processing apparatus provided in an embodiment of this application. The apparatus includes an acquisition unit 501, a modification unit 502, and an output unit 503.

[0079] The acquisition unit 501 is used to acquire the initial log corresponding to the SQL statement;

[0080] The modification unit 502 is used to modify the print class corresponding to the initial log, and add the transaction information corresponding to the SQL statement to the print class to obtain the transaction log;

[0081] The output unit 503 is used to restore the transaction log using regular expressions, filter the environment information in the SQL statement, and output an executable SQL statement.

[0082] In one possible implementation, the modification unit is further configured to:

[0083] The transaction information is added to the print class by modifying the print class using Javaassit, thus obtaining the transaction log.

[0084] In one possible implementation, the output unit is further used for:

[0085] The regular expression is used to split and assemble the Preparing, Parameters, and Total statements corresponding to the transaction log to filter the environment information and obtain the initial SQL statement corresponding to the SQL statement.

[0086] The initial SQL statement is formatted to obtain a standard SQL statement;

[0087] Obtain the transaction information from the transaction log;

[0088] The transaction information is added to the header of the standard SQL statement to obtain the executable SQL statement.

[0089] In one possible implementation, the device further includes an execution unit and a debugging unit:

[0090] The execution unit is used to execute the executable SQL statement and obtain the execution result;

[0091] The acquisition unit is also used to acquire the transaction result corresponding to the transaction information;

[0092] The debugging unit is used to debug the executable SQL statement based on the difference between the execution result and the transaction result.

[0093] In one possible implementation, the transaction information includes an entry transaction code and a transaction version.

[0094] In one possible implementation, the initial log and the transaction log are Mybatis logs.

[0095] As can be seen from the above technical solution, the initial log corresponding to the SQL statement is obtained, and the print class corresponding to the initial log is modified to add the transaction information corresponding to the SQL statement to the print class, thus obtaining the transaction log. The transaction information represents the transaction entry point corresponding to the SQL statement; therefore, adding it to the print class ensures that the transaction log has the transaction entry point corresponding to the SQL statement compared to the initial log, facilitating debugging using the SQL statement. Simultaneously, regular expressions are used to restore the transaction log, filtering environment information in the SQL statement and outputting an executable SQL statement. Environment information refers to interference information included in the SQL statement. The presence of environment information prevents the SQL statement from being executed directly after printing, thus making it unusable for debugging. Therefore, filtering the environment information using regular expressions ensures that the filtered SQL statement is executable after printing. Compared to debugging methods in related technologies, this application first modifies the print class of the initial log corresponding to the SQL statement to include the transaction information corresponding to the SQL statement in the transaction log, and simultaneously filters the environment information in the SQL statement, achieving the purpose of restoring the SQL statement. Because transaction information is added, subsequent debugging can be directly performed using the executable SQL statement, simplifying the debugging process.

[0096] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory:

[0097] The memory is used to store program code and transmit the program code to the processor;

[0098] The processor is used to execute the data processing method provided in the above embodiments according to the instructions in the program code.

[0099] The computer device may include a terminal device or a server, and the aforementioned data processing device may be configured in the computer device.

[0100] In another aspect, embodiments of this application also provide a storage medium for storing a computer program for executing the data processing method provided in the above embodiments.

[0101] In addition, this application also provides a computer program product including instructions, which, when run on a computer, causes the computer to execute the data processing method provided in the above embodiments.

[0102] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disk, etc., and other media capable of storing program code.

[0103] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0104] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0105] The data processing method and related apparatus provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method of this application. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the method of this application.

[0106] In summary, the content of this specification should not be construed as limiting this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. Furthermore, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.

Claims

1. A data processing method, characterized by, The method includes: Retrieve the initial log corresponding to the SQL statement; Modify the print class corresponding to the initial log, and add the transaction information corresponding to the SQL statement to the print class to obtain the transaction log; the transaction information is used to represent the transaction entry point corresponding to the SQL statement; The transaction log is restored using regular expressions to filter out environment information in the SQL statement and output an executable SQL statement. The environment information refers to the interference information included in the SQL statement, which makes the SQL statement unexecutable after being printed directly.

2. The method of claim 1, wherein, The modification of the print class corresponding to the initial log, by adding the transaction information corresponding to the SQL statement to the print class to obtain the transaction log, includes: The transaction information is added to the print class by modifying it using Javaassit, thus obtaining the transaction log.

3. The method of claim 1, wherein, The process of restoring the transaction log using regular expressions, filtering environment information in the SQL statements, and outputting executable SQL statements includes: The regular expression is used to split and assemble the Preparing, Parameters, and Total statements corresponding to the transaction log to filter the environment information and obtain the initial SQL statement corresponding to the SQL statement. The initial SQL statement is formatted to obtain a standard SQL statement; Obtain the transaction information from the transaction log; The transaction information is added to the header of the standard SQL statement to obtain the executable SQL statement.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Execute the executable SQL statement and obtain the execution result; Obtain the transaction result corresponding to the transaction information; The executable SQL statement is debugged based on the difference between the execution result and the transaction result.

5. The method according to any one of claims 1 to 3, characterized in that, The transaction information includes the entry transaction code and the transaction version.

6. The method according to any one of claims 1 to 3, characterized in that, The initial log and the transaction log are Mybatis logs.

7. A data processing apparatus, characterized in that, The device includes an acquisition unit, a modification unit, and an output unit: The acquisition unit is used to acquire the initial log corresponding to the SQL statement; The modification unit is used to modify the print class corresponding to the initial log, and add the transaction information corresponding to the SQL statement to the print class to obtain the transaction log; the transaction information is used to represent the transaction entry point corresponding to the SQL statement; The output unit is used to restore the transaction log using regular expressions, filter the environment information in the SQL statement, and output an executable SQL statement; the environment information refers to the interference information included in the SQL statement, making the SQL statement unexecutable after direct printing.

8. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method described in any one of claims 1-6 according to the instructions in the program code.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-6.

10. A computer program product comprising instructions that, when run on a computer, cause the computer to perform the method of any one of claims 1-6.