Data operation trace processing method, electronic equipment and computer program product

By pre-encapsulating the target trace-keeping interface, the data operation trace-keeping is realized without any action processing, solving the problem of hard coding time and dependence on the encoding level, improving the standardization and independence of trace-keeping results, and reducing development costs.

CN119226119AInactive Publication Date: 2024-12-31CLOUDWING NETWORK TECH CO INC
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411756920.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the hard-coded method of data operations leaving traces takes a long time and depends on the developer's coding level, resulting in poor universality, poor standardization and traceability.

Method used

Provide a data operation trace-keeping method. By pre-encapsulating the target trace-keeping interface, developers can realize sensorless trace-keeping processing by simply inheriting the interface, calling the interface to trigger the trace-keeping operation method, generating and storing trace data To an independent trace data table, reduce development costs and improve standardization of trace results.

Benefits of technology

It realizes the non-responsive processing of data operations, reduces development costs, improves the standardization and independence of trace results, avoids the impact on the business data operation process, and saves data storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226119A_ABST
    Figure CN119226119A_ABST
Patent Text Reader

Abstract

The invention provides a data operation trace processing method, electronic equipment and a computer program product, and relates to the technical field of data processing. The method comprises the following steps: receiving a data operation instruction for business data; the type of the business data is a target business type; executing data operation according to the data operation instruction, and calling a target trace interface when the data operation is executed; and when the target trace-leaving interface is executed, triggering to execute a plurality of trace-leaving operation methods to generate trace-leaving data for the business data, and storing the trace-leaving data into a trace-leaving data table corresponding to the target business type. According to the method, a universal trace-leaving interface is realized, and during trace-leaving processing, a developer does not need to write a program by himself, and only needs to inherit a target trace-leaving interface through a data operation method, so that the development cost is reduced. And on the premise of not depending on the programming level of developers, the normalization of the generated trace reserving result can be improved by calling a universal target trace reserving interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data operation trace processing method, electronic equipment and computer program product. Background Art

[0002] In some fields with high data security requirements, it is necessary to leave traces during the data operation process, such as recording the data operator, operation time, operation items, etc. The recorded data plays an important role in subsequent quality control and risk prevention.

[0003] At present, hard coding is often used to achieve data operation traceability. For each type of data addition, deletion, and modification, manual coding is required to achieve traceability.

[0004] This method is time-consuming and, due to inconsistent code styles, heavily relies on the coding level of developers, resulting in poor universality, non-standardized trace results, and poor traceability. Summary of the invention

[0005] The purpose of this application is to provide a data operation trace processing method, electronic device and computer program product to address the deficiencies in the above-mentioned prior art, so as to facilitate the seamless implementation of data traces, reduce the cost of code development, and improve the standardization of trace results.

[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows: In a first aspect, an embodiment of the present application provides a data operation trace processing method, comprising: receiving a data operation instruction for business data; the type of the business data is a target business type; According to the data operation instruction, perform data operation, and call the target trace interface when performing the data operation; When the target trace interface is executed, multiple trace operation methods are triggered to generate trace data for the business data, and the trace data is stored in a trace data table corresponding to the target business type.

[0007] In a second aspect, an embodiment of the present application further provides a data operation trace processing device, including: a receiving module and an execution module; The receiving module is used to receive a data operation instruction for business data; the type of the business data is a target business type; The execution module is used to execute data operations according to the data operation instructions, and call the target trace interface when executing the data operation; The execution module is used to trigger the execution of multiple trace operation methods when the target trace interface is executed, so as to generate trace data for the business data, and store the trace data in the trace data table corresponding to the target business type.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to implement the data operation trace processing method provided in the first aspect.

[0009] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the data operation trace processing method provided in the first aspect is executed.

[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program code. When the computer program code is executed by a computing device, the computing device executes the data operation trace processing method provided in the first aspect.

[0011] The beneficial effects of this application are: The present application provides a data operation trace processing method, electronic device and computer program product, including: receiving a data operation instruction for business data, the type of the business data is a target business type; according to the data operation instruction, performing data operation, and calling the target trace interface when performing the data operation; when the target trace interface is executed, triggering the execution of multiple trace operation methods to generate trace data for the business data, and storing the trace data in the trace data table corresponding to the target business type. This method pre-encapsulates the target trace interface. During the development process, it only needs to inherit the target trace interface to achieve the senseless implementation of trace processing. During the application process, it only needs to call the target trace interface to trigger the execution of the target trace interface through the initiated data operation instruction. When the target trace interface is executed, the trace data of the business data can be generated and stored in the corresponding trace data table. This method realizes a generalized trace interface. When doing trace processing, developers do not need to write programs by themselves, but only need to inherit the target trace interface through the data operation method, which reduces the development cost. And under the premise of not relying on the programming level of developers, by calling the general target trace interface, the standardization of the generated trace results can be improved.

[0012] Secondly, in the process of processing traces, the data operation process of business data is decoupled from the trace processing process of business data, and an independent trace data table is created for the trace data. The generated trace data is stored in the independent trace data table. Therefore, when the trace processing of business data is implemented, it will not affect the data operation process of the business data, nor will it affect the business data table that stores the business data operation results.

[0013] In addition, by defining a traceability interface, the traceability interface is implemented only for business data that requires trace processing, which can avoid trace processing of the entire data, reduce the amount of data processing, and save space occupied by data storage.

[0014] Finally, the target trace interface also defines a trace query method, so that calling the target trace interface can also realize the query of trace data and provide data support for data auditing. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 A schematic diagram of the architecture of a data operation trace processing system provided in an embodiment of the present application; Figure 2 A flowchart of a data operation trace processing method provided in an embodiment of the present application; Figure 3 A flowchart of another data operation trace processing method provided in an embodiment of the present application; Figure 4 A flowchart of another data operation trace processing method provided in an embodiment of the present application; Figure 5 A schematic diagram of the architecture of another data operation trace processing system provided in an embodiment of the present application; Figure 6 A flowchart of another data operation trace processing method provided in an embodiment of the present application; Figure 7 A flowchart of another data operation trace processing method provided in an embodiment of the present application; Figure 8 A schematic diagram of a data operation trace processing device provided in an embodiment of the present application; Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0017] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0018] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0019] Data traceability refers to the generation and recording of operation trace data during the process of software information system operating data (such as adding, deleting, modifying, querying, etc.). These trace data can also be called trace data. These trace data play an important role in audit quality control, risk prevention, and proving that auditors comply with relevant laws, regulations and audit standards.

[0020] At present, hard coding is often used to implement data trace processing, which usually requires developers to manually write trace-related codes for trace processing. This is time-consuming, and because each developer has a different coding style, the quality of the trace results is extremely dependent on the developer's coding level.

[0021] In addition, there is another way to use a trigger mode similar to the trigger function of the database feature to trigger the addition, deletion and modification operations of related tables to achieve data traceability. However, this method relies on database features, requires repeated development, and has poor maintainability.

[0022] Based on this, this solution provides a data operation trace processing method, which pre-encapsulates the target trace interface. During the development process, you only need to inherit the target trace interface to achieve seamless implementation of trace processing. During the application process, you only need to call the target trace interface to trigger the execution of the target trace interface through the initiated data operation instructions. When the target trace interface is executed, the trace data of the business data can be generated and stored in the corresponding trace data table. A universal trace interface is implemented. When doing trace processing, developers do not need to write programs themselves, but only need to inherit the target trace interface through data operation methods, which reduces development costs. And without relying on the programming level of developers, by calling the universal target trace interface, the standardization of the generated trace results can be improved.

[0023] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0024] Figure 1 A schematic diagram of the architecture of a data operation trace processing system provided in an embodiment of the present application, combined with Figure 1 , the execution flow of the data operation trace processing method of the present application is explained: business data can be classified according to the type of business data, and different types of business data can be processed independently to achieve personalized trace processing according to needs. The various types of business data that need to be traced can define a trace capability interface to achieve the ability to track and record the information that needs to be traced; by encapsulating a general target trace interface, various types of business data that define a trace capability interface can inherit the target trace interface through data operation methods. When performing data operations on various types of business data, the trace operation methods such as the method for obtaining the maximum trace version number and the method for inserting the trace result in the target trace interface can be called to generate trace data for the business data and store it in the corresponding trace data table.

[0025] Among them, when the trace operation method in the target trace interface is executed, it can be based on the dynamic mapping interface and according to the various methods defined in the trace capability interface, map the business fields corresponding to the trace items in the business data into trace item SQL (Structured Query Language) fields, and generate an SQL statement for executing the trace operation method, so that based on the generated SQL statement, the trace data corresponding to each trace item is accessed from the business data table corresponding to the business data and recorded in the fields corresponding to each trace item in the trace data table.

[0026] Figure 2The following is a flow chart of a data operation trace processing method provided in an embodiment of the present application; the execution subject of the method can be a computer device such as a terminal or a server. Figure 2 As shown, the method may include: S101: Receive a data operation instruction for business data.

[0027] The type of business data is the target type. Business data can be divided into different types in advance according to different data types, and each type of business data can be processed independently, so that users can perform corresponding trace processing on each type of business data according to their needs.

[0028] Optionally, a business scenario may include multiple business types, each business type may include multiple business data, and the data operation instruction may be an operation instruction for one or more business data under a certain business type.

[0029] For example, in a business scenario, the following business types may be included: counterparty, account, transaction, product, asset, financial instrument, etc. Among them, for the business type of "transaction", business data such as "commodity transaction data", "capital transaction data" and "stock transaction data" may be included.

[0030] Exemplarily, the target business type may be, for example, a business type of "transaction", and the user may input a data operation instruction for the business data of "commodity transaction data" under the target business type.

[0031] Optionally, a data operation instruction for business data input may be received, and the data operation instruction may be initiated by a developer or a business caller. The data operation instruction is used to instruct a conventional database operation on the business data, such as adding, deleting, modifying, etc.

[0032] S102. Execute data operation according to the data operation instruction, and call the target trace interface when executing the data operation.

[0033] During the program development stage, the target trace interface can be pre-packaged, and the business data that needs to be processed by trace can inherit the target trace interface through data operation methods. For developers, there is no need to additionally implement related functions of data trace, thus achieving a seamless implementation of the trace function.

[0034] During the stage of executing trace operations, when data operations are performed on business data, the above-mentioned data operation method is triggered to be executed. The data operations performed may be, for example, operations such as adding, deleting, modifying, and searching data. When the above-mentioned data operation method is executed, the target trace interface may be called to implement trace processing of the business data.

[0035] S103. When the target trace interface is executed, multiple trace operation methods are triggered to generate trace data for business data, and the trace data is stored in a trace data table corresponding to the target business type.

[0036] When the target trace interface is executed, it can trigger the execution of multiple trace operation methods, which are used to obtain and record the specified operation trace data of the business data.

[0037] When the trace operation method is executed, trace data of business data can be generated according to the function to be achieved by the trace operation method, and the trace data can be stored in the trace data table corresponding to the target business type.

[0038] Among them, the association relationship between each type of business data and the corresponding trace data table can be established in advance. Each business type corresponds to a trace data table. In this case, each business data under the business type can correspond to a specified area in this trace data table to achieve independent storage of trace data of different types of business data, which is convenient for subsequent data management.

[0039] Alternatively, each type of business data under each business type may correspond to an independent trace data table, so that the trace data of the business data generated above can be stored in the trace data table corresponding to the business data. In other words, one business type may correspond to one trace data table, or one business data under one business type may correspond to one trace data table. It is sufficient to be able to distinguish and store the trace data.

[0040] It is worth noting that in the process of processing traces, this method decouples the data operation process of business data from the trace processing process of business data, creates an independent trace data table for the trace data, and stores the generated trace data in the independent trace data table. Therefore, when implementing trace processing of business data, it will not affect the data operation process of the business data, nor will it affect the business data table that stores the results of the business data operation.

[0041] Optionally, the trace data is stored in the above-mentioned trace data table, which can be used in subsequent auditing scenarios.

[0042] In summary, the data operation trace processing method provided in this embodiment includes: receiving a data operation instruction for business data; performing data operation according to the data operation instruction, and calling the target trace interface when performing the data operation; when the target trace interface is executed, triggering the execution of multiple trace operation methods to generate trace data for business data, and storing the trace data in the trace data table corresponding to the target business type. This method pre-encapsulates the target trace interface. During the development process, it only needs to inherit the target trace interface to achieve the senseless implementation of trace processing. During the application process, it only needs to call the target trace interface to trigger the execution of the target trace interface through the initiated data operation instruction. When the target trace interface is executed, the trace data of the business data can be generated and stored in the corresponding trace data table. This method realizes a generalized trace interface. When doing trace processing, developers do not need to write programs by themselves, but only need to inherit the target trace interface through the data operation method, which reduces the development cost. And under the premise of not relying on the programming level of developers, by calling the general target trace interface, the standardization of the generated trace results can be improved.

[0043] Secondly, in the process of processing traces, the data operation process of business data is decoupled from the trace processing process of business data, and an independent trace data table is created for the trace data. The generated trace data is stored in the independent trace data table. Therefore, when the trace processing of business data is implemented, it will not affect the data operation process of the business data, nor will it affect the business data table that stores the business data operation results.

[0044] Figure 3 A flowchart of another data operation trace processing method provided in an embodiment of the present application; optionally, in step S103, when the target trace interface is executed, multiple trace operation methods are triggered to generate trace data for business data, and the trace data is stored in a trace data table corresponding to the target business type, which may include: S201. When the target trace interface is executed, the method for obtaining the maximum trace version number is triggered to generate the current trace version number of the business data.

[0045] The target trace interface defines a method for obtaining the maximum trace version number, for example, getMaxVersion. The function of the method for obtaining the maximum trace version number is to obtain the maximum trace version number from the trace data table of the business data. It can also refer to obtaining the latest trace version number, that is, the version number of the last stored trace data.

[0046] When the method for obtaining the maximum trace version number is executed, the maximum trace version number can be obtained from the trace data table of the business data, and the current trace version number of the business data can be generated based on the maximum trace version number.

[0047] A corresponding trace version number is generated for each trace of business data, and the trace data can be queried based on the trace version number later.

[0048] S202. Trigger execution of the trace result insertion method to obtain each trace item under the business data, and insert each trace item into the trace data table corresponding to the target business type.

[0049] The target trace interface also defines methods for inserting trace results, such as insertAuditResult. The function of the insert trace result method is to insert the fields of each trace item in the trace data table based on the defined trace items, and obtain the trace data records corresponding to each trace item from the business data table and put them under the fields of each trace item.

[0050] Optionally, when the trace result insertion method is executed, the fields of each trace item under the business data can be generated and inserted into the trace data table, and the trace data of each trace item can be obtained based on each trace item and recorded under the field of each trace item.

[0051] Optionally, in step S201, triggering the execution of the method for obtaining the maximum traceable version number to generate the current traceable version number of the business data may include: triggering the execution of the method for obtaining the maximum traceable version number, when the method for obtaining the maximum traceable version number is executed, generating a first statement based on the dynamic mapping interface, and obtaining the current traceable version number based on the first statement.

[0052] The dynamic mapping interface may be an interface generated based on the dynamic mapper technology. Based on the dynamic mapping interface, database access statements may be dynamically generated.

[0053] In one feasible manner, when the method for obtaining the maximum traceable version number is executed, the dynamic mapping interface can be called to generate a first statement. The first statement here refers to an SQL statement that implements the method for obtaining the maximum traceable version number. Thus, through the first statement, the maximum traceable version number can be queried from the trace data table corresponding to the business data, and the current traceable version number can be generated based on the maximum traceable version number.

[0054] Figure 4 A flowchart of another data operation trace processing method provided in an embodiment of the present application; optionally, obtaining the current trace version number based on the first statement may include: S301. Read the maximum version number of the trace currently recorded for the business data from the trace data table based on the first statement.

[0055] For the same business data, in order to distinguish the trace data generated corresponding to different batches of data operations on the business data, a trace version number can be recorded for each trace data generated. Then, the trace data generated in the data operation of the business data can uniquely correspond to a trace version number, and the trace version number can be recorded as one of the trace items in the trace data table corresponding to the business data.

[0056] When the first statement is executed, the maximum trace version number currently recorded can be queried from the trace data table corresponding to the business data, that is, the trace version number generated by the last trace processing can be obtained.

[0057] S302. Generate the current trace version number according to the maximum trace version number and the preset version number update strategy.

[0058] When the version number update strategy is to add 1 to the version number, based on the maximum traceable version number obtained, 1 can be added to the maximum traceable version number to obtain the current traceable version number. Of course, it can also be implemented according to different strategies such as adding 2 or adding n to the version number.

[0059] In some embodiments, when the trace version number is not represented by a number, there may be other version number update strategies. For example, when the trace version number is represented by a string, a current trace version number that is different from all recorded trace version numbers can be generated based on all currently recorded trace version numbers.

[0060] Optionally, in step S202, triggering the execution of the insert trace result method to obtain each trace item under the business data, and inserting each trace item into the trace data table corresponding to the target business type, may include: triggering the execution of the insert trace result method, when the insert trace result method is executed, obtaining each trace item based on the dynamic mapping interface, and generating a second statement, and inserting the trace result into the trace data table based on the second statement.

[0061] Similarly, when the insert trace result method is executed, the corresponding trace item is obtained by calling the dynamic mapping interface.

[0062] It is worth noting that the trace items refer to the parameters that need to be traced, or the trace results. The trace items can be pre-configured according to the needs, and can be configured according to the various types of data that can effectively evaluate the audit process in the audit quality control process. In this embodiment, the trace items can be, for example: trace version number, operator, operation time, operation description, etc.

[0063] In addition, a second statement can also be generated based on the dynamic mapping interface. The second statement refers to an SQL statement that can insert each trace item and the trace result corresponding to each trace item into the trace database corresponding to the business data.

[0064] In the process of performing data operations on business data, information such as who is the operator who performed the operation, the operation time, and the specific operation performed on the business data can be recorded.

[0065] When the trace result insert method is executed, the trace result of each trace item can be obtained from the business data table of the business data, and based on the second statement, the trace result of each trace item is recorded under the field of each trace item.

[0066] For example, assuming that the trace item is: operator, and the business data table shows that the operator is Zhang San, then Zhang San can be recorded as the trace result in the field corresponding to the operator in the trace data table.

[0067] Optionally, the step of obtaining each trace item based on the dynamic mapping interface and generating a second statement may include: calling the trace capability interface by the dynamic mapping interface to obtain operation data items related to data operations, mapping the operation data items related to data operations into trace items, and dynamically generating the second statement based on each trace item.

[0068] A traceability interface can be pre-defined, which defines a set of methods or properties. These methods and properties are common to business data that need to be traced. The defined methods can, for example, track the operator of business data, track the update time of business data, or track the operation content of business data.

[0069] It is worth noting that the methods or properties defined in the traceability interface may be related to the defined trace items, and these methods defined in the traceability interface may track and record the trace results of the defined trace items.

[0070] For each type of business that requires trace processing, a trace capability interface needs to be implemented so that the required trace results can be provided to the dynamic mapping interface.

[0071] Optionally, the dynamic mapping interface may map the aforementioned operation data items into the aforementioned trace items through the trace capability interface based on Java reflection technology, and dynamically generate the second statement based on each trace item.

[0072] In this solution, the trace capability interface can be implemented for business data that needs to be processed. For business data that implements the trace capability interface, the trace result corresponding to the trace item can be obtained based on the insert trace result method and the defined trace item and inserted into the trace data table. Business data that does not need to be processed does not need to implement the trace capability interface.

[0073] By defining the traceability interface, the huge amount of data processing caused by trace processing of the entire business data can be avoided, and the space occupied by data storage can be saved.

[0074] In one achievable manner, when the trace result insertion method is executed, the dynamic mapping interface may be called, and when the dynamic mapping interface is executed, the trace capability interface implemented by the business data may be called to obtain operation data items related to the data operation. The operation data items may be recorded operation data items or operation data items generated in real time during the operation process. For example, the operation data items may be: operator, operation time, operation description, etc.

[0075] It is worth noting that during the data operation process, the specific type of the data operation item is not known, that is, it is not known which data operation item is the operator and which data operation item is the operation time. Through the dynamic mapping interface and the trace capability interface, the Java reflection technology can be used to map the operation data items related to the data operation into trace items, that is, the fields corresponding to each trace item in the business operation data are mapped to the SQL field of the trace item, and based on the SQL field of the trace item, the second statement is dynamically generated. The second statement obtains the trace results of each trace item from the business data table based on the SQL field of the trace item, and inserts the trace results into the field of the corresponding trace item in the trace data table.

[0076] The above embodiment describes how to record trace data during data operation from the perspective of the business caller. Multiple trace query methods can also be defined in the target trace interface, so that when the target trace interface is executed, it can trigger the execution of multiple trace query methods to query the trace data.

[0077] Figure 5 A schematic diagram of the architecture of another data operation trace processing system provided in an embodiment of the present application, such as Figure 5 As shown, in Figure 1 On the basis of the target trace interface, trace query methods such as the first trace query method and the second trace query method can also be defined. When querying trace data, the first trace query method and the second trace query method in the target trace interface can be called to query the corresponding trace data from the trace data table of the business data. Among them, the first trace query method can be, for example, a method for obtaining corresponding trace data according to a specified version number, and the second trace query method can be, for example, a method for outputting trace data in pages according to the version number.

[0078] Figure 6 A flowchart of another data operation trace processing method provided in an embodiment of the present application; optionally, the method of the present application may also include: S401. Receive a first audit trace query instruction for business data, where the first audit trace query instruction includes a target version number.

[0079] Optionally, a first audit trace query instruction initiated by a data reviewer for business data may be received. The first audit trace query instruction is used to instruct to query and obtain trace data corresponding to a target version number from a trace data table of business data based on a target version number.

[0080] S402. According to the first audit trace query instruction, call the target trace interface.

[0081] Based on the received first audit trace query instruction, the target trace interface can be called for execution.

[0082] S403: When the target trace interface is executed, the first trace query method is triggered to query and obtain the trace data of the target version number of the business data.

[0083] The target trace interface defines a first trace query method, which may be: a method for obtaining corresponding trace data according to a specified version number, for example: getByVersion.

[0084] When the target trace interface is executed, the first trace query method is triggered to execute. When the first trace query method is executed, the trace data corresponding to the target version number can be queried from the trace data table of the business data according to the target version number contained in the first audit trace query instruction.

[0085] Optionally, in step S403, triggering execution of the first trace query method to query and obtain trace data of the target version number of the business data may include: The first trace query method is triggered to execute. When the first trace query method is executed, a third statement is generated based on the dynamic mapping interface, and trace data of the target version number is queried from the trace data table based on the third statement.

[0086] Similarly, when the first trace query method is executed, the dynamic mapping interface can be called to dynamically generate an SQL statement that can realize the method of obtaining the corresponding trace data according to the specified version number, and the third statement also refers to the SQL statement that can obtain the corresponding trace data method according to the specified version number. Therefore, based on the generated third statement, the trace data corresponding to the target version number can be queried from the trace data table corresponding to the business data.

[0087] Figure 7 A flowchart of another data operation trace processing method provided in an embodiment of the present application; optionally, the method of the present application may also include: S501. Receive a second audit trace query instruction for business data, where the second audit trace query instruction includes multiple version numbers to be checked.

[0088] Optionally, a second audit trace query instruction initiated by the data reviewer for business data may be received. The second audit trace query instruction is used to instruct to query and obtain trace data corresponding to each version number to be checked from the trace data table of business data based on multiple version numbers to be checked and output them in pages.

[0089] S502. According to the second audit trace query instruction, call the target trace interface.

[0090] Based on the received second audit trace query instruction, the target trace interface can be called for execution.

[0091] S503: When the target trace interface is executed, the second trace query method is triggered to query and obtain the trace data of each version number to be queried of the business data.

[0092] The target trace interface also defines a second trace query method, which may be a method for outputting trace data in pages according to the version number, for example, pageOrderingVersion.

[0093] When the target trace interface is executed, the second trace query method is triggered. When the second trace query method is executed, the trace data corresponding to each version number to be checked can be queried from the trace data table of the business data according to each version number to be checked contained in the second audit trace query instruction, and the trace data corresponding to each version number to be checked can be output in pages. In this way, when there is a lot of trace data to be queried, the trace data corresponding to each version number can be displayed on one page to distinguish and display trace data of different versions for easy viewing.

[0094] Optionally, in step S503, the second trace query method is triggered to be executed to query and obtain the trace data of each version number to be queried of the business data, including: triggering the execution of the second trace query method, when the second trace query method is executed, generating a fourth statement based on the dynamic mapping interface, and querying and obtaining the trace data of each version number to be queried from the trace data table based on the fourth statement.

[0095] Similarly, when the second trace query method is executed, the dynamic mapping interface can be called to dynamically generate an SQL statement that can implement the method of outputting trace data in pages according to the version number. The fourth statement also refers to the SQL statement that can output the trace data in pages according to the version number. Based on the generated fourth statement, the trace data corresponding to each version number to be queried can be queried from the trace data table corresponding to the business data, and the trace data corresponding to each version number to be queried can be output in pages.

[0096] In summary, the data operation trace processing method provided in this embodiment includes: receiving a data operation instruction for business data; performing data operation according to the data operation instruction, and calling the target trace interface when performing the data operation; when the target trace interface is executed, triggering the execution of multiple trace operation methods to generate trace data for business data, and storing the trace data in the trace data table corresponding to the target business type. This method pre-encapsulates the target trace interface. During the development process, it only needs to inherit the target trace interface to achieve the senseless implementation of trace processing. During the application process, it only needs to call the target trace interface to trigger the execution of the target trace interface through the initiated data operation instruction. When the target trace interface is executed, the trace data of the business data can be generated and stored in the corresponding trace data table. This method realizes a generalized trace interface. When doing trace processing, developers do not need to write programs by themselves, but only need to inherit the target trace interface through the data operation method, which reduces the development cost. And under the premise of not relying on the programming level of developers, by calling the general target trace interface, the standardization of the generated trace results can be improved.

[0097] Secondly, in the process of processing traces, the data operation process of business data is decoupled from the trace processing process of business data, and an independent trace data table is created for the trace data. The generated trace data is stored in the independent trace data table. Therefore, when the trace processing of business data is implemented, it will not affect the data operation process of the business data, nor will it affect the business data table that stores the business data operation results.

[0098] In addition, by defining a traceability interface, the traceability interface is implemented only for business data that requires trace processing, which can avoid trace processing of the entire data, reduce the amount of data processing, and save space occupied by data storage.

[0099] Finally, the target trace interface also defines a trace query method, so that calling the target trace interface can also realize the query of trace data and provide data support for data auditing.

[0100] The following describes the devices, equipment, storage media, etc. used to execute the data operation trace processing method provided in this application. The specific implementation process and technical effects are mentioned above and will not be repeated below.

[0101] Figure 8 A schematic diagram of a data operation trace processing device provided in an embodiment of the present application, the functions implemented by the data operation trace processing device correspond to the steps performed by the above method. The device can be understood as the above server, or the processor of the server, or can be understood as a component independent of the above server or processor that implements the functions of the present application under the control of the server, such as Figure 8As shown, the device may include: a receiving module 110 and an execution module 120; The receiving module 110 is used to receive a data operation instruction for business data; the type of the business data is a target business type; An execution module 120, configured to execute data operations according to data operation instructions, and to call a target trace interface when executing data operations; The execution module 120 is used to trigger the execution of multiple trace operation methods when the target trace interface is executed, so as to generate trace data for business data and store the trace data in a trace data table corresponding to the target business type.

[0102] Optionally, the execution module 120 is specifically used to trigger the execution of the method for obtaining the maximum trace version number when the target trace interface is executed, so as to generate the current trace version number of the business data; and Trigger the execution of the insert trace result method to obtain each trace item under the business data, and insert each trace item into the trace data table corresponding to the target business type.

[0103] Optionally, the execution module 120 is specifically used to trigger the execution of the method for obtaining the maximum traceable version number. When the method for obtaining the maximum traceable version number is executed, a first statement is generated based on the dynamic mapping interface, and the current traceable version number is obtained based on the first statement.

[0104] Optionally, the execution module 120 is specifically configured to read the maximum version number of the trace currently recorded in the business data from the trace data table based on the first statement; According to the maximum version number of the trace, the current trace version number is generated according to the preset version number update strategy.

[0105] Optionally, the execution module 120 is specifically used to trigger the execution of the trace result insertion method. When the trace result insertion method is executed, each trace item is obtained based on the dynamic mapping interface, and a second statement is generated. The trace result is inserted into the trace data table based on the second statement.

[0106] Optionally, the execution module 120 is specifically used to call the trace capability interface through the dynamic mapping interface, obtain operation data items related to data operations, map the operation data items related to data operations into trace items, and dynamically generate a second statement based on each trace item.

[0107] Optionally, the receiving module 110 is further configured to receive a first audit trace query instruction for business data, wherein the first audit trace query instruction includes a target version number; The execution module 120 is further used to call the target trace interface according to the first audit trace query instruction; The execution module 120 is also used to trigger the execution of the first trace query method when the target trace interface is executed, so as to query and obtain the trace data of the target version number of the business data.

[0108] Optionally, the execution module 120 is specifically used to trigger the execution of the first trace query method. When the first trace query method is executed, a third statement is generated based on the dynamic mapping interface, and trace data of the target version number is queried from the trace data table based on the third statement.

[0109] Optionally, the receiving module 110 is further configured to receive a second audit trace query instruction for the business data, wherein the second audit trace query instruction includes a plurality of version numbers to be checked; The execution module 120 is further used to call the target trace interface according to the second audit trace query instruction; The execution module 120 is also used to trigger the execution of the second trace query method when the target trace interface is executed, so as to query and obtain the trace data of each version number to be queried of the business data.

[0110] Optionally, the execution module 120 is specifically used to trigger the execution of the second trace query method. When the second trace query method is executed, a fourth statement is generated based on the dynamic mapping interface, and the trace data of each version number to be queried is queried from the trace data table based on the fourth statement.

[0111] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0112] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0113] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.

[0114] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, referring to Fig. 9 As shown, the device may be a computing device with data processing capabilities.

[0115] The device may include: a processor 801 and a storage medium 802 .

[0116] The storage medium 802 is used to store programs, and the processor 801 calls the programs stored in the storage medium 802 to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0117] Among them, the storage medium 802 stores program code. When the program code is executed by the processor 801, the processor 801 executes various steps in the data operation trace processing method according to various exemplary embodiments of the present application described in the above "Exemplary Method" section of this specification.

[0118] The processor 801 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and may implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0119] The storage medium 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The storage medium may include at least one type of storage medium, for example, a flash memory, a hard disk, a multimedia card, a card-type storage medium, a random access storage medium (Random Access Memory, RAM), a static random access storage medium (Static Random Access Memory, SRAM), a programmable read-only storage medium (Programmable Read Only Memory, PROM), a read-only storage medium (Read Only Memory, ROM), an electrically erasable programmable read-only storage medium (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic storage medium, a disk, an optical disk, and the like. The storage medium is any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The storage medium 802 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0120] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute the above method embodiment when executed by a processor.

[0121] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0124] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only storage medium (English: Read-Only Memory, referred to as: ROM), random access storage medium (English: Random Access Memory, referred to as: RAM), disk or optical disk and other media that can store program codes.

Claims

1. A data operation trace processing method, characterized in that: include: receiving a data operation instruction for business data; the type of the business data is a target business type; According to the data operation instruction, perform data operation, and call the target trace interface when performing the data operation; When the target trace interface is executed, multiple trace operation methods are triggered to generate trace data for the business data, and the trace data is stored in a trace data table corresponding to the target business type.

2. The method according to claim 1, characterized in that When the target trace interface is executed, multiple trace operation methods are triggered to generate trace data for the business data, and the trace data is stored in the trace data table corresponding to the target business type, including: When the target trace interface is executed, a method for obtaining the maximum trace version number is triggered to generate the current trace version number of the business data; and Trigger the execution of the trace result insertion method to obtain each trace item under the business data, and insert each trace item into the trace data table corresponding to the target business type.

3. The method according to claim 2, characterized in that The triggering execution of the method for obtaining the maximum trace version number to generate the current trace version number of the business data includes: The method for obtaining the maximum traceable version number is triggered to execute. When the method for obtaining the maximum traceable version number is executed, a first statement is generated based on the dynamic mapping interface, and the current traceable version number is obtained based on the first statement.

4. The method according to claim 3, characterized in that The obtaining the current trace version number based on the first statement includes: Based on the first statement, read the maximum version number of the trace currently recorded for the business data from the trace data table; According to the maximum traceable version number and the preset version number update strategy, the current traceable version number is generated.

5. The method according to claim 2, characterized in that: The triggering execution inserting trace result method to obtain each trace item under the business data and insert each trace item into the trace data table corresponding to the target business type includes: The method of inserting the trace result is triggered to execute. When the method of inserting the trace result is executed, each trace item is obtained based on the dynamic mapping interface, and a second statement is generated. The trace result is inserted into the trace data table based on the second statement.

6. The method according to claim 5, characterized in that The step of obtaining each trace item based on the dynamic mapping interface and generating a second statement includes: The dynamic mapping interface calls the trace capability interface to obtain the operation data items related to the data operation, maps the operation data items related to the data operation into the trace items, and dynamically generates the second statement based on each of the trace items.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Receiving a first audit trace query instruction for the business data, wherein the first audit trace query instruction includes a target version number; According to the first audit trace query instruction, calling the target trace interface; When the target trace interface is executed, it triggers the execution of the first trace query method to query and obtain the trace data of the target version number of the business data.

8. The method according to claim 7, characterized in that The triggering execution of the first trace query method to query and obtain the trace data of the target version number of the business data includes: The first trace query method is triggered to execute. When the first trace query method is executed, a third statement is generated based on the dynamic mapping interface, and the trace data of the target version number is queried from the trace data table based on the third statement.

9. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: receiving a second audit trace query instruction for the business data, wherein the second audit trace query instruction includes a plurality of version numbers to be checked; According to the second audit trace query instruction, calling the target trace interface; When the target trace interface is executed, the second trace query method is triggered to query and obtain the trace data of each version number to be queried of the business data.

10. The method according to claim 9, characterized in that The triggering and executing the second trace query method to query and obtain the trace data of each version number to be queried of the business data includes: The second trace query method is triggered to execute. When the second trace query method is executed, a fourth statement is generated based on the dynamic mapping interface. Based on the fourth statement, the trace data of each version number to be queried is queried from the trace data table to obtain the trace data.

11. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to implement the data operation trace processing method as described in any one of claims 1 to 10.

12. A computer program product, characterized in that The computer program product includes a computer program code. When the computer program code is executed by a computing device, the computing device executes the data operation trace processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Log query method, device, equipment and computer readable storage medium

    CN110659349A

  • Log management method, device, and system, equipment and readable storage medium

    CN112650753A

  • Log operation method and device, electronic equipment and computer readable storage medium

    CN113849469A

  • Data query method, device and equipment

    CN117609294A

  • Application log fragment parallel generation and multi-level materialized view aggregation processing method

    CN118643017A