Data tracing method and device, computer equipment and readable storage medium

By using the traceback serial number and forward traceback sequence number in the change record log in the database table, data can be traced from new to old, solving the problem of high data change record management costs and improving data traceability efficiency.

CN118626538APending Publication Date: 2024-09-10KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410729010.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

When data changes in the database, change records need to be stored synchronously and rely on third-party databases during traceability, resulting in reduced data traceability efficiency and increased management costs.

Method used

By obtaining the target data row identifier of the data row to be traced in the database table, and using the traceback sequence number and forward traceability sequence number in the change record log, the change records are gradually matched and traversed, and the data can be traced from new to old until the initial change. Records without the involvement of a third-party database.

Benefits of technology

It improves the efficiency of data traceability, reduces the management cost of data change records, and simplifies the data traceability process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626538A
    Figure CN118626538A
Patent Text Reader

Abstract

The invention relates to a data tracing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a first target data row identifier corresponding to a to-be-traced data row in a database table, and acquiring a first target tracing sequence number corresponding to the first target data row identifier; obtaining a first target traceability change record matched with the first target traceability sequence number in a change record log, and obtaining a forward traceability sequence number corresponding to the first target traceability change record; and obtaining a matched target forward traceability change record based on the forward traceability sequence number corresponding to the first target traceability change record, and traversing each forward traceability change record corresponding to the first target data line identifier based on the target forward traceability change record until an initial change record corresponding to the first target data line identifier is traced. By adopting the method, the data tracing efficiency can be improved, and the management cost of data change records can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer data processing, and in particular to a data tracing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] In the field of computer data processing technology, if data in a database table changes, the data change record is synchronously stored in a relational database. When tracing the data in the database, the corresponding data change record needs to be queried in the relational database.

[0003] During this process, when the data is changed, the data change records need to be synchronously stored in the third-party database, and when the changed data is traced, it is necessary to trace it based on the data change records stored in the third-party database. Based on this, the efficiency of data tracing is reduced, and the cost of management and maintenance of data change records is increased. Summary of the invention

[0004] Based on this, it is necessary to provide a data tracing method, device, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of data tracing and reduce the management cost of data change records in response to the above technical problems.

[0005] In a first aspect, the present application provides a data tracing method, comprising:

[0006] Obtaining a first target data row identifier corresponding to the data row to be traced in the database table, and obtaining a first target tracing sequence number corresponding to the first target data row identifier in the change record log based on the first target data row identifier;

[0007] In the change record log, the first target traceability change record matching the first target traceability sequence number is obtained, and the forward traceability sequence number corresponding to the first target traceability change record is obtained; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number;

[0008] In the change record log, a matching target forward tracing change record is obtained based on the forward tracing sequence number corresponding to the first target tracing change record, and each forward tracing change record corresponding to the first target data row identifier is traversed based on the target forward tracing change record until an initial change record corresponding to the first target data row identifier is traced back; the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

[0009] In a second aspect, the present application also provides a data tracing device, comprising:

[0010] an acquisition module, configured to acquire a first target data row identifier corresponding to a data row to be traced in a database table, and acquire a first target traceability sequence number corresponding to the first target data row identifier in a change record log based on the first target data row identifier;

[0011] a matching module, configured to obtain, from the change record log, a first target traceability change record that matches the first target traceability sequence number, and obtain a forward traceability sequence number corresponding to the first target traceability change record; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number;

[0012] a tracing module, configured to obtain, in the change record log, a matching target forward tracing change record based on a forward tracing sequence number corresponding to the first target tracing change record, and traverse each forward tracing change record corresponding to the first target data row identifier based on the target forward tracing change record until tracing back to an initial change record corresponding to the first target data row identifier; and the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

[0013] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above steps when executing the computer program.

[0014] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above steps when executed by a processor.

[0015] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the above steps when executed by a processor.

[0016] The data tracing method, apparatus, computer device, computer-readable storage medium and computer program product match the first target tracing sequence number corresponding to the first target data row identifier of the data row to be traced in the change record log to obtain the first target tracing change record corresponding to the data row, and then match the forward tracing sequence number of the first target tracing change record to obtain the target forward tracing change record before the first target tracing change record. Based on this, according to the association relationship between the current tracing sequence number and the forward tracing sequence number between two adjacent change records corresponding to the same data row, each change record of the same data row is traced in order from the newest to the oldest until the initial change record is traced, so that data tracing can be achieved only based on the storage content in the change record log without the participation of a third-party database in processing, thereby improving the efficiency of data tracing and reducing the management cost of data change records. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 A schematic diagram of a flow chart of a data tracing method in one embodiment;

[0019] Figure 2 It is a structural block diagram of a data tracing device in one embodiment;

[0020] Figure 3 is an internal structure diagram of a computer device in one embodiment;

[0021] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] In an exemplary embodiment, Figure 1 As shown, a data tracing method is provided. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a server and a terminal, and is implemented through the interaction between the server and the terminal. In this embodiment, the method includes the following steps S102 to S106, wherein:

[0024] Step S102: obtaining a first target data row identifier corresponding to the data row to be traced in the database table, and obtaining a first target tracing sequence number corresponding to the first target data row identifier in the change record log based on the first target data row identifier.

[0025] Among them, the database table is a data structure that stores and organizes data in a tabular form; the data row represents each row of data in the database table, and the data row identifier represents the unique identifier corresponding to each row of data; the first target data row identifier represents the data row identifier corresponding to the data row to be traced.

[0026] Optionally, the data row identifier may represent the arrangement sequence number of each row of data in the database table; it may also represent the creation timestamp of each row of data in the database table; it may also represent the unique external identifier contained in each row of data, such as an ID number, order number, product code, etc.

[0027] Among them, the change record log is a log file that stores the change records of the data rows in the database table, that is, the change record log includes the change records corresponding to different data rows in the database table in each change operation, and each change record is arranged in the change record log according to the creation timestamp; each change record includes the content of the data row after the change, the current tracing sequence number, and the forward tracing sequence number corresponding to the current tracing sequence number, wherein the current tracing sequence number in the change record represents the arrangement sequence number of the change record in the change record log, and the forward tracing sequence number in the change record represents the current tracing sequence number of the change record corresponding to the data row recorded in the change record before the change record.

[0028] Optionally, the arrangement sequence number of the change record in the change record log may be represented as a Long type format LSN (Log Sequence Number), and each change record is sorted in the change record log in ascending order of the corresponding LSN.

[0029] Optionally, the association relationship between the current tracing sequence number and the forward tracing sequence number in the change record may be set according to the step length of data tracing. For example, if the step length of data tracing is 1, the forward tracing sequence number in the change record is set to the current tracing sequence number of the previous change record corresponding to the data row recorded in the change record before the change record; if the step length of data tracing is 10, the forward tracing sequence number in the change record is set to the current tracing sequence number of the first change record among the first ten change records corresponding to the data row recorded in the change record before the change record.

[0030] Among them, the first target traceability sequence number corresponding to the first target data row identifier is used to match the latest change record corresponding to the data row to which the first target data row identifier belongs in the change record log, and it is consistent with the current traceability sequence number corresponding to the latest change record.

[0031] Optionally, the first target traceability sequence number may also match the creation timestamp corresponding to the latest change record, so as to find the latest change record corresponding to the data row to be traced in the change record log through the first target traceability sequence number.

[0032] Among them, the change operation can represent operations such as inserting, deleting, and updating values ​​in the data row, or it can represent operations such as adding and deleting the data row as a whole; when deleting a data row as a whole, the data row identifier corresponding to the deleted data row is stored to ensure that the deleted data row can be traced based on the stored data row identifier, and the data row identifier corresponding to the data row retained in the database table can remain unchanged or be adjusted accordingly based on the data row identifier of the deleted data row.

[0033] Optionally, the change log may represent a WAL log (Write Ahead Log), which is used to ensure consistency and durability of the database and to recover data in the event of a failure.

[0034] Step S104, in the change record log, obtain the first target traceability change record that matches the first target traceability sequence number, and obtain the forward traceability sequence number corresponding to the first target traceability change record; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number.

[0035] Step S106: in the change record log, a matching target forward tracing change record is obtained based on the forward tracing sequence number corresponding to the first target tracing change record, and each forward tracing change record corresponding to the first target data row identifier is traversed based on the target forward tracing change record until the initial change record corresponding to the first target data row identifier is traced back; the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

[0036] The first target traceability change record indicates the latest change record of the data row to which the first target traceability sequence number belongs in the change record log, and the forward traceability sequence number corresponding to the first target traceability change record matches the current traceability sequence number corresponding to the target forward traceability change record; the first target traceability change record and the target forward traceability change record correspond to the same data row, and in the change record log, the arrangement sequence number of the target forward traceability change record is smaller than the arrangement sequence number of the first target traceability change record.

[0037] It can be understood that in the change record log, after removing the change records corresponding to other data rows, when the step length of data tracing is 1, the first target tracing change record and the target forward tracing change record may represent two adjacent change records, and the target forward tracing change record represents the previous change record relative to the first target tracing change record.

[0038] Exemplarily, the target forward tracing change record is used as a new target tracing change record, and a new target forward tracing change record is matched according to the forward tracing sequence number corresponding to the new target tracing change record, and a loop operation is performed until all change records corresponding to the same to-be-traced data row are traversed.

[0039] Optionally, each traced change record may be displayed in sequence in a new log file; or each traced change record may be retained and displayed in an original log file, and change records corresponding to other data rows may be hidden.

[0040] Optionally, the target of data tracing can be customized, for example, specifying data tracing back to the change record belonging to a specific change time, or the change record belonging to a specific tracing sequence number, or the change record belonging to a specific change operation.

[0041] Optionally, the data tracing operation may be performed on a specified number of data rows in the database table simultaneously or sequentially.

[0042] Optionally, if the database table and the change record log are both stored in the server, the above method can be implemented based on the server; if the database table and the change record log are both stored in the terminal, the above method can be implemented based on the terminal; if the database table and the change record log are respectively stored in one of the server and the terminal, the above method can be implemented based on the interaction between the server and the terminal.

[0043] In this embodiment, the first target tracing sequence number corresponding to the first target data row identifier of the data row to be traced is used to match the first target tracing change record corresponding to the data row in the change record log, and then the target forward tracing change record before the first target tracing change record is matched through the forward tracing sequence number of the first target tracing change record. Based on this, according to the association relationship between the current tracing sequence number and the forward tracing sequence number between two adjacent change records corresponding to the same data row, each change record of the same data row is traced in order from the newest to the oldest until the initial change record is traced. In this way, data tracing can be achieved only based on the storage content in the change record log without the participation of a third-party database in processing, thereby improving the efficiency of data tracing and reducing the management cost of data change records.

[0044] In an exemplary embodiment, the method further includes steps S202 to S204, wherein:

[0045] Step S202: Obtain the second target data row identifier corresponding to the changed data row in the database table, and use the second target traceability serial number corresponding to the second target data row identifier as the second target traceability serial number to be updated.

[0046] Step S204, obtaining the target latest change record corresponding to the second target data row identifier in the change record log, and updating the second target traceability number to be updated according to the current traceability number corresponding to the target latest change record to obtain an updated second target traceability number.

[0047] The changed data row refers to the data row whose content is changed in the database table according to the current change operation before the next change operation is performed, and the data row identifier of the data row has not yet been associated with the current traceability number of its latest change record.

[0048] The second target data row identifier indicates the data row identifier corresponding to the above-mentioned changed data row.

[0049] The target latest change record indicates the latest change record corresponding to the above-mentioned changed data row; when the data row is changed, the latest change record is synchronously generated in the change record log.

[0050] Illustratively, the second target traceability sequence number before updating matches the traceability sequence number corresponding to the change record of the changed data row in its last change operation; and the second target traceability sequence number after updating matches the traceability sequence number corresponding to the change record of the changed data row in its current change operation, that is, matches the traceability sequence number corresponding to the latest change record of the data row.

[0051] Optionally, the update time of the second target traceability serial number may be set accordingly according to the change time of the data row. For example, when the data row changes, the second target traceability serial number corresponding to the data row is synchronously updated; for another example, when the data row changes, the second target traceability serial number corresponding to the data row is updated after a preset time period; for another example, before the next change of the data row occurs, the second target traceability serial number corresponding to the current change of the data row is updated.

[0052] In this embodiment, when a data row is changed, the target traceability serial number corresponding to the data row is updated to ensure that the latest change record corresponding to the data row can be accurately matched in the change record log according to the updated target traceability serial number.

[0053] In an exemplary embodiment, obtaining the target latest change record corresponding to the second target data row identifier in the change record log includes steps S302 to S304, wherein:

[0054] Step S302: based on the second target traceability serial number corresponding to the second target data row identifier, obtain the second target traceability change record corresponding to the second target traceability serial number in the change record log.

[0055] The second target traceability change record indicates a change record of the corresponding data row in the last change operation obtained by matching in the change record log according to the second target traceability sequence number that has not been updated.

[0056] Step S304, by taking the current tracing sequence number corresponding to the second target tracing change record as the forward tracing sequence number corresponding to the target latest change record, and taking the arrangement sequence number of the target latest change record in the change record log as the current tracing sequence number corresponding to the target latest change record, the target latest change record including the corresponding current tracing sequence number and the corresponding forward tracing sequence number is obtained.

[0057] Exemplarily, after obtaining the target latest change record including the corresponding current tracing sequence number and the corresponding forward tracing sequence number, the second target tracing sequence number is updated to ensure that the second target tracing sequence number matches the current tracing sequence number corresponding to the target latest change record.

[0058] In this embodiment, the current tracing sequence number corresponding to the change record of the data row in the previous change operation is used as the forward tracing sequence number corresponding to the change record in the current change operation, and the arrangement sequence number of the change record of the data row in the current change operation in the change record log is used as the current tracing sequence number corresponding to the change record in the current change operation, so as to accurately determine the current tracing sequence number and the forward tracing sequence number in the latest change record corresponding to the data row, and establish an association relationship between the two.

[0059] In an exemplary embodiment, after obtaining the first target traceability change record matching the first target traceability sequence number in the change record log, the method further includes steps S402 to S404, wherein:

[0060] Step S402: in the first target retrospective change record, obtain the target change sequence corresponding to the current change operation; the change sequence is used to represent the execution order of different change operations.

[0061] The target change order indicates the change order corresponding to the current change operation; each change operation may be sorted from front to back according to the corresponding execution time to obtain the change order corresponding to each change operation.

[0062] Optionally, in a change operation, it may correspond to the change of one data row, or to the simultaneous change of multiple data rows, that is, according to the range of data rows affected by the change operation, the same change order may correspond to the change record of one data row in the change operation, or to the change records corresponding to multiple data rows in the change operation.

[0063] Step S404, obtaining a plurality of third target retroactive change records that match the target change sequence; the plurality of third target retroactive change records represent change records corresponding to different data rows affected by the change operation of the same change sequence.

[0064] The third target traceability change record represents the latest change records corresponding to different data rows affected by the change operations of the same change sequence.

[0065] Optionally, according to the third target tracing change records respectively corresponding to the matched multiple data rows, data tracing can be performed on the respectively corresponding data rows; or the respectively corresponding data rows can be screened to obtain the data rows that need to be further traced, and according to the third target tracing change records corresponding to the screened data rows, the screened data rows can be traced, and further different data rows matched according to the same change order can be screened again, and the cycle is repeated.

[0066] In this embodiment, according to the change order corresponding to the change operation, the latest change records corresponding to different data rows of the same change order are completely and comprehensively obtained to achieve the integrity of data traceability at the level of global changes in the database table.

[0067] In an exemplary embodiment, traversing each forward tracing change record corresponding to the first target data row identifier based on the target forward tracing change record includes steps S502 to S506, wherein:

[0068] Step S502: If the traced forward tracing change record is stored in an archive file, a target archive file matching the target current tracing sequence number is obtained according to the target current tracing sequence number corresponding to the traced forward tracing change record; each archive file includes the same number of change record logs, and each change record log in the archive file includes the same number of change records.

[0069] The traced forward tracing change record indicates any forward tracing change record matched by the data row to be traced in the change record log; the target current tracing sequence number indicates the current tracing sequence number corresponding to the traced forward tracing change record.

[0070] The archive file refers to a file that organizes, classifies and stores multiple change logs in the form of specific labels, numbers, dates, etc. The target archive file refers to an archive file that matches the target current traceability sequence number, that is, the archive file contains the change record corresponding to the target current traceability sequence number, and the current traceability sequence number of the change record is consistent with the target current traceability sequence number.

[0071] Exemplarily, when the number of change records stored in the first change record log meets the preset quantity threshold condition, the subsequent change records are stored in the second change record log, and the sorting number of the change records in the second change record log continues the last sorting number of the change records in the first change record log, that is, the sorting numbers corresponding to the last change record in the first change record log and the first change record in the second change record log are numerically adjacent.

[0072] Exemplarily, each archive file and the change record log in each archive file are named based on the serial number corresponding to the stored change record; based on the corresponding names of the archive files or change record logs, archive files or change record logs including specified change records can be matched.

[0073] Optionally, the name of the change record log may correspond to the numerical range involved in the sorting numbers of the change records stored therein. For example, the naming field of the change record log includes the sorting number corresponding to the first change record and the sorting number corresponding to the last change record.

[0074] Optionally, the naming of the archive file may correspond to the numerical range involved in the sorting numbers of the change records in the change record log stored therein. For example, the naming field of the archive file includes the sorting number corresponding to the first change record in the first change record log, and the sorting number corresponding to the last change record in the last change record log.

[0075] Optionally, the change record log can be named based on the hexadecimal long type format so that the capacity of each change record log is 16M: for example, the change record log is named "00_0000_0000", indicating that the change record log is used to store change records with arrangement numbers from 0*16*1024*1024 to 1*16*1024*1024; for another example, the change record log is named "00_0000_000F", indicating that the change record log is used to store change records with arrangement numbers from 15*16*1024*1024 to 16*16*1024*1024.

[0076] Step S504: Obtain a target change record log matching the target current traceability sequence number in the target archive file.

[0077] Step S506: Obtain a forward tracing change record that matches the target current tracing sequence number in the target change record log.

[0078] The target change record log indicates the change record log that matches the target current traceability sequence number, that is, the change record log contains the forward traceability change record corresponding to the target current traceability sequence number, and the current traceability sequence number of the forward traceability change record is consistent with the target current traceability sequence number.

[0079] In this embodiment, the change records stored in the change record log in the archive file are traced back, so that the data is hierarchically and accurately traced at the archive file level and the change record log level in turn while saving computer storage resources.

[0080] In an exemplary embodiment, the method further includes steps S602 to S606, wherein:

[0081] Step S602, store the change records in the current change record log according to the corresponding serial numbers. If the number of change records stored in the current change record log meets the first threshold condition, store the change records after the stored change records in a new change record log.

[0082] Exemplarily, if after the Ath change record is stored in the current change record log, so that the number of change records stored in the current change record log meets the first threshold condition, then the change records after the Ath change record, that is, the change records starting from the (A+1)th change record, are stored in a new change record log until the number of change records stored in the new change record log meets the same first threshold condition, thereby ensuring that the number of change records stored in each change record log matches.

[0083] Step S604: if the number of existing change record logs meets the second threshold condition, a preset number of change record logs are retained, and the remaining change record logs are stored in the current archive file.

[0084] Exemplarily, if there are B change record logs, so that the number of existing change record logs meets the second threshold condition, then C of the change record logs will be retained, and the other (BC) change record logs will be stored in the current archive file, wherein the (BC) change record logs belong to the (BC) change record logs since the change record log with the earliest creation time, which is equivalent to preferentially storing the change record logs with earlier creation time in the archive file, and preferentially displaying the change record logs with later creation time.

[0085] Optionally, when storing the specified change record log in an archive file, and after a period of time, if the number of unarchived change record logs meets the second threshold condition again, then each time a new change record log is added, the unarchived change record log with the earliest creation time may be stored in the archive file; or, each time a certain number of change record logs are added, a corresponding number of change record logs starting from the unarchived change record log with the earliest creation time may be stored in the archive file.

[0086] Step S606: If the number of change record logs stored in the current archive file meets the third threshold condition, the change record logs subsequent to the stored change record logs are stored in the new archive file.

[0087] Exemplarily, if after the Dth change record log is stored in the current archive file, so that the number of change record logs stored in the current archive file meets the third threshold condition, then the change record logs after the Dth change record log, that is, the change record logs starting from the (D+1)th change record log, are stored in a new archive file until the number of change record logs stored in the new archive file meets the same third threshold condition, thereby ensuring that the number of change record logs stored in each archive file matches.

[0088] Optionally, 1024 change logs may be retained by default, and the change logs before the 1024 change logs may be incrementally backed up and compressed, and every 16 files may be compressed into an archive file and stored in a corresponding backup directory.

[0089] In this embodiment, the change records are stored hierarchically and efficiently at the change record log level and the archive file level, so that the data can be traced efficiently and accurately according to the hierarchical storage method while saving computer storage resources.

[0090] In an exemplary embodiment, Table 1 shows some tables in a database table, where the row number represents the serial number of the corresponding row position of the data row in the database table, which can be used as the data row identifier of the data row; the dimension combination represents the information that comprehensively describes multiple attributes of the data, and the metric value represents the quantitative result calculated under the corresponding dimension combination. For example, when the dimension combination represents the combination of time, region, and product, the metric value represents the sales amount corresponding to a specific time, specific region, and specific product. In addition, based on the characteristics of the dimension combination, the database table can be represented as a multi-dimensional data table for processing multi-dimensional data.

[0091] Among them, Table 1 includes data rows with row number 1, row number 2, row number 3, and row number 4, as well as the dimension combinations and measurement values ​​in the above data rows: the dimension combination and measurement values ​​of the data row with row number 1 are Key_1 and Value_1 respectively, the dimension combination and measurement values ​​of the data row with row number 2 are Key_2 and Value_2 respectively, the dimension combination and measurement values ​​of the data row with row number 3 are Key_3 and Value_3 respectively, and the dimension combination and measurement values ​​of the data row with row number 4 are Key_4 and Value_4 respectively.

[0092]

[0093] Table 1

[0094] Table 2 shows the target tracing sequence number corresponding to each data row, that is, the current tracing sequence number of the latest change record corresponding to each data row in the log change log.

[0095] Among them, Table 2 includes the target traceability serial numbers corresponding to the data rows with row numbers 1, 2, 3, and 4 respectively: the target traceability serial number corresponding to the data row with row number 1 is 90112, the target traceability serial number corresponding to the data row with row number 2 is 81920, the target traceability serial number corresponding to the data row with row number 3 is 24576, and the target traceability serial number corresponding to the data row with row number 4 is 8192. Among them, Table 1 and Table 2 can be stored independently, or they can be merged and stored together according to the row numbers corresponding to the data rows in Table 1 and Table 2.

[0096]

[0097] Table 2

[0098] Table 3 shows some change records in the change record log, wherein each change record includes row information, information after the change, and information before the change; the row information includes the row number of the data row to which the change record belongs.

[0099] The changed information includes the change order, change type, changed value, and the current traceability number; the change order indicates the execution order corresponding to the change operation, the change type indicates the operation type corresponding to the change operation, and the changed value indicates the changed content of the cell corresponding to the "Measurement Value" in Table 1 of the data row to which the change record belongs.

[0100] The information before the change includes the change order before the change, the value before the change, and the forward tracing number; the change order before the change indicates the change order of the data row to which the change record belongs in the previous change operation, and the value after the change indicates the content of the cell corresponding to the "Measurement Value" in Table 1 of the data row to which the change record belongs before the change.

[0101] Among them, Table 3 includes the change records corresponding to the data rows with row numbers 1 and 2 in the change record log: the change record with the traceability sequence number 49152 indicates that through the first change operation, an insert operation is performed on the cell corresponding to the "measurement value" of the data row with row number 1 in Table 1, and the value of the cell is changed from a null value to 20; the change record with the traceability sequence number 57344 indicates that through the second change operation, an insert operation is performed on the cell corresponding to the "measurement value" of the data row with row number 2 in Table 1, and the value of the cell is changed from a null value to 30.

[0102] The change record with the current tracing sequence number of 81920 and the forward tracing sequence number of 57344 indicates that, through the 7th change operation, an update operation is performed on the cell corresponding to the "metric value" of the data row with row number 2 in Table 1, and the value of the cell is changed from 30 obtained in the 2nd change operation to 40; the change record with the current tracing sequence number of 90112 and the forward tracing sequence number of 49152 indicates that, through the 7th change operation, an update operation is performed on the cell corresponding to the "metric value" of the data row with row number 1 in Table 1, and the value of the cell is changed from 20 obtained in the 1st change operation to 10.

[0103]

[0104] Table 3

[0105] When tracing data for the data row with row number 1 in Table 1, the target tracing sequence number of the data row is obtained as 90112 according to the target tracing sequence number stored in Table 2; according to the obtained target tracing sequence number, the change record with the current tracing sequence number 90112 is matched in the change record log, that is, the latest change record of the data row in the change record log; according to the forward tracing sequence number 49152 corresponding to the latest change record, the change record with the current tracing sequence number 49152 is matched in the change record log, that is, the previous change record corresponding to the latest change record of the data row in the change record log, thereby tracing each change record of the data row.

[0106] When the content of the data row with row number 1 in Table 1 is changed again, a corresponding change record is added in the change record log, and the change record is used as the latest change record of the data row. The traceability sequence number of the latest change record continues the arrangement sequence number of the change record in the change record log, and the traceability sequence number corresponding to the change record with the traceability sequence number 90112 is used as the forward traceability sequence number of the latest change record. The target traceability sequence number of the data row is updated in Table 2 accordingly.

[0107] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0108] Based on the same inventive concept, the embodiment of the present application also provides a data tracing device for implementing the data tracing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data tracing device embodiments provided below can refer to the limitations on the data tracing method above, and will not be repeated here.

[0109] In an exemplary embodiment, Figure 2 As shown, a data tracing device is provided, including: an acquisition module 202, a matching module 204 and a tracing module 206, wherein:

[0110] An acquisition module 202 is used to acquire a first target data row identifier corresponding to the data row to be traced in the database table, and acquire a first target traceability sequence number corresponding to the first target data row identifier in the change record log based on the first target data row identifier;

[0111] The matching module 204 is used to obtain the first target traceability change record that matches the first target traceability sequence number in the change record log, and obtain the forward traceability sequence number corresponding to the first target traceability change record; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number;

[0112] The tracing module 206 is used to obtain a matching target forward tracing change record in the change record log based on the forward tracing sequence number corresponding to the first target tracing change record, and traverse each forward tracing change record corresponding to the first target data row identifier based on the target forward tracing change record until the initial change record corresponding to the first target data row identifier is traced back; the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

[0113] In an exemplary embodiment, the device also includes an update module, which is used to: obtain a second target data row identifier corresponding to the changed data row in the database table, and use the second target traceability sequence number corresponding to the second target data row identifier as the second target traceability sequence number to be updated; obtain the target latest change record corresponding to the second target data row identifier in the change record log, and update the second target traceability sequence number to be updated according to the current traceability sequence number corresponding to the target latest change record to obtain an updated second target traceability sequence number.

[0114] In an exemplary embodiment, the update module is further used to: obtain the second target traceability change record corresponding to the second target traceability sequence number in the change record log based on the second target traceability sequence number corresponding to the second target data row identifier; obtain the target latest change record including the corresponding current traceability sequence number and the corresponding forward traceability sequence number by using the current traceability sequence number corresponding to the second target traceability change record as the forward traceability sequence number corresponding to the target latest change record, and using the arrangement sequence number of the target latest change record in the change record log as the current traceability sequence number corresponding to the target latest change record.

[0115] In an exemplary embodiment, the matching module 204 is further used to: obtain a target change order corresponding to the current change operation in the first target retroactive change record; the change order is used to characterize the arrangement order of different change operations; obtain multiple third target retroactive change records that match the target change order; the multiple third target retroactive change records represent change records corresponding to different data rows affected by the change operations of the same change order.

[0116] In an exemplary embodiment, the tracing module 206 is further used for: if the traced forward tracing change record is stored in an archive file, then according to the target current tracing sequence number corresponding to the traced forward tracing change record, obtaining a target archive file matching the target current tracing sequence number; each archive file includes the same number of change record logs, and each change record log in the archive file includes the same number of change records; in the target archive file, obtaining a target change record log matching the target current tracing sequence number; in the target change record log, obtaining a forward tracing change record matching the target current tracing sequence number.

[0117] In an exemplary embodiment, the device also includes an archiving module, which is used to: store the change records in the current change record log according to the corresponding serial number; if the number of change records stored in the current change record log meets the first threshold condition, the change records after the stored change records are stored in a new change record log; if the number of existing change record logs meets the second threshold condition, a preset number of change record logs are retained and the remaining change record logs are stored in the current archive file; if the number of change record logs stored in the current archive file meets the third threshold condition, the change record logs after the stored change record logs are stored in the new archive file.

[0118] Each module in the above data tracing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0119] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 3 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data for tracing the change records of the data rows in the database table. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data tracing method is implemented.

[0120] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 4As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a data tracing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0121] Those skilled in the art will understand that Figure 3 and Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0122] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0123] Obtaining a first target data row identifier corresponding to the data row to be traced in the database table, and obtaining a first target tracing sequence number corresponding to the first target data row identifier in the change record log based on the first target data row identifier;

[0124] In the change record log, obtain the first target traceability change record that matches the first target traceability sequence number, and obtain the forward traceability sequence number corresponding to the first target traceability change record; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number;

[0125] In the change record log, a matching target forward tracing change record is obtained based on the forward tracing sequence number corresponding to the first target tracing change record, and each forward tracing change record corresponding to the first target data row identifier is traversed based on the target forward tracing change record until the initial change record corresponding to the first target data row identifier is traced back; the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

[0126] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining a second target data row identifier corresponding to the changed data row in the database table, and using a second target traceability sequence number corresponding to the second target data row identifier as the second target traceability sequence number to be updated; obtaining a target latest change record corresponding to the second target data row identifier in the change record log, and updating the second target traceability sequence number to be updated according to the current traceability sequence number corresponding to the target latest change record to obtain an updated second target traceability sequence number.

[0127] In one embodiment, when the processor executes the computer program, the following steps are further implemented: based on the second target tracing sequence number corresponding to the second target data row identifier, obtaining the second target tracing change record corresponding to the second target tracing sequence number in the change record log; by using the current tracing sequence number corresponding to the second target tracing change record as the forward tracing sequence number corresponding to the target latest change record, and using the arrangement sequence number of the target latest change record in the change record log as the current tracing sequence number corresponding to the target latest change record, obtaining the target latest change record including the corresponding current tracing sequence number and the corresponding forward tracing sequence number.

[0128] In one embodiment, when the processor executes the computer program, the following steps are further implemented: in the first target retroactive change record, a target change order corresponding to the current change operation is obtained; the change order is used to characterize the arrangement order of different change operations; a plurality of third target retroactive change records matching the target change order are obtained; the plurality of third target retroactive change records represent change records corresponding to different data rows acted upon by the change operation of the same change order.

[0129] In one embodiment, when the processor executes the computer program, the following steps are further implemented: if the traced forward tracing change record is stored in an archive file, then according to the target current tracing sequence number corresponding to the traced forward tracing change record, a target archive file matching the target current tracing sequence number is obtained; each archive file includes the same number of change record logs, and each change record log in the archive file includes the same number of change records; in the target archive file, a target change record log matching the target current tracing sequence number is obtained; in the target change record log, a forward tracing change record matching the target current tracing sequence number is obtained.

[0130] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the change records are stored in the current change record log according to the corresponding serial number; if the number of change records stored in the current change record log meets the first threshold condition, the change records after the stored change records are stored in a new change record log; if the number of existing change record logs meets the second threshold condition, a preset number of change record logs are retained, and the remaining change record logs are stored in the current archive file; if the number of change record logs stored in the current archive file meets the third threshold condition, the change record logs after the stored change record logs are stored in the new archive file.

[0131] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0132] Obtaining a first target data row identifier corresponding to the data row to be traced in the database table, and obtaining a first target tracing sequence number corresponding to the first target data row identifier in the change record log based on the first target data row identifier;

[0133] In the change record log, obtain the first target traceability change record that matches the first target traceability sequence number, and obtain the forward traceability sequence number corresponding to the first target traceability change record; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number;

[0134] In the change record log, a matching target forward tracing change record is obtained based on the forward tracing sequence number corresponding to the first target tracing change record, and each forward tracing change record corresponding to the first target data row identifier is traversed based on the target forward tracing change record until the initial change record corresponding to the first target data row identifier is traced back; the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

[0135] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining a second target data row identifier corresponding to the changed data row in the database table, and using a second target traceability sequence number corresponding to the second target data row identifier as the second target traceability sequence number to be updated; obtaining a target latest change record corresponding to the second target data row identifier in the change record log, and updating the second target traceability sequence number to be updated according to the current traceability sequence number corresponding to the target latest change record to obtain an updated second target traceability sequence number.

[0136] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: based on the second target tracing sequence number corresponding to the second target data row identifier, obtaining the second target tracing change record corresponding to the second target tracing sequence number in the change record log; by using the current tracing sequence number corresponding to the second target tracing change record as the forward tracing sequence number corresponding to the target latest change record, and using the arrangement sequence number of the target latest change record in the change record log as the current tracing sequence number corresponding to the target latest change record, obtaining the target latest change record including the corresponding current tracing sequence number and the corresponding forward tracing sequence number.

[0137] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: in the first target retroactive change record, a target change order corresponding to the current change operation is obtained; the change order is used to characterize the arrangement order of different change operations; a plurality of third target retroactive change records matching the target change order are obtained; the plurality of third target retroactive change records represent change records corresponding to different data rows acted upon by the change operation of the same change order.

[0138] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if the traced forward tracing change record is stored in an archive file, then according to the target current tracing sequence number corresponding to the traced forward tracing change record, a target archive file matching the target current tracing sequence number is obtained; each archive file includes the same number of change record logs, and each change record log in the archive file includes the same number of change records; in the target archive file, a target change record log matching the target current tracing sequence number is obtained; in the target change record log, a forward tracing change record matching the target current tracing sequence number is obtained.

[0139] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the change records are stored in the current change record log according to the corresponding serial number; if the number of change records stored in the current change record log meets the first threshold condition, the change records after the stored change records are stored in a new change record log; if the number of existing change record logs meets the second threshold condition, a preset number of change record logs are retained and the remaining change record logs are stored in the current archive file; if the number of change record logs stored in the current archive file meets the third threshold condition, the change record logs after the stored change record logs are stored in the new archive file.

[0140] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0141] Obtaining a first target data row identifier corresponding to the data row to be traced in the database table, and obtaining a first target tracing sequence number corresponding to the first target data row identifier in the change record log based on the first target data row identifier;

[0142] In the change record log, obtain the first target traceability change record that matches the first target traceability sequence number, and obtain the forward traceability sequence number corresponding to the first target traceability change record; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number;

[0143] In the change record log, a matching target forward tracing change record is obtained based on the forward tracing sequence number corresponding to the first target tracing change record, and each forward tracing change record corresponding to the first target data row identifier is traversed based on the target forward tracing change record until the initial change record corresponding to the first target data row identifier is traced back; the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

[0144] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining a second target data row identifier corresponding to the changed data row in the database table, and using a second target traceability sequence number corresponding to the second target data row identifier as the second target traceability sequence number to be updated; obtaining a target latest change record corresponding to the second target data row identifier in the change record log, and updating the second target traceability sequence number to be updated according to the current traceability sequence number corresponding to the target latest change record to obtain an updated second target traceability sequence number.

[0145] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: based on the second target tracing sequence number corresponding to the second target data row identifier, obtaining the second target tracing change record corresponding to the second target tracing sequence number in the change record log; by using the current tracing sequence number corresponding to the second target tracing change record as the forward tracing sequence number corresponding to the target latest change record, and using the arrangement sequence number of the target latest change record in the change record log as the current tracing sequence number corresponding to the target latest change record, obtaining the target latest change record including the corresponding current tracing sequence number and the corresponding forward tracing sequence number.

[0146] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: in the first target retroactive change record, a target change order corresponding to the current change operation is obtained; the change order is used to characterize the arrangement order of different change operations; a plurality of third target retroactive change records matching the target change order are obtained; the plurality of third target retroactive change records represent change records corresponding to different data rows acted upon by the change operation of the same change order.

[0147] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if the traced forward tracing change record is stored in an archive file, then according to the target current tracing sequence number corresponding to the traced forward tracing change record, a target archive file matching the target current tracing sequence number is obtained; each archive file includes the same number of change record logs, and each change record log in the archive file includes the same number of change records; in the target archive file, a target change record log matching the target current tracing sequence number is obtained; in the target change record log, a forward tracing change record matching the target current tracing sequence number is obtained.

[0148] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the change records are stored in the current change record log according to the corresponding serial number; if the number of change records stored in the current change record log meets the first threshold condition, the change records after the stored change records are stored in a new change record log; if the number of existing change record logs meets the second threshold condition, a preset number of change record logs are retained and the remaining change record logs are stored in the current archive file; if the number of change record logs stored in the current archive file meets the third threshold condition, the change record logs after the stored change record logs are stored in the new archive file.

[0149] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0150] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0151] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data tracing method, characterized in that: The method comprises: Obtaining a first target data row identifier corresponding to the data row to be traced in the database table, and obtaining a first target tracing sequence number corresponding to the first target data row identifier in the change record log based on the first target data row identifier; In the change record log, the first target traceability change record matching the first target traceability sequence number is obtained, and the forward traceability sequence number corresponding to the first target traceability change record is obtained; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number; In the change record log, a matching target forward tracing change record is obtained based on the forward tracing sequence number corresponding to the first target tracing change record, and each forward tracing change record corresponding to the first target data row identifier is traversed based on the target forward tracing change record until an initial change record corresponding to the first target data row identifier is traced back; the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

2. The method according to claim 1, characterized in that The method further comprises: Acquire a second target data row identifier corresponding to the changed data row in the database table, and use a second target traceability serial number corresponding to the second target data row identifier as the second target traceability serial number to be updated; The target latest change record corresponding to the second target data row identifier is obtained in the change record log, and the second target traceability number to be updated is updated according to the current traceability number corresponding to the target latest change record to obtain an updated second target traceability number.

3. The method according to claim 2, characterized in that The obtaining the target latest change record corresponding to the second target data row identifier in the change record log includes: Based on the second target traceability serial number corresponding to the second target data row identifier, obtaining the second target traceability change record corresponding to the second target traceability serial number in the change record log; By taking the current tracing sequence number corresponding to the second target tracing change record as the forward tracing sequence number corresponding to the target latest change record, and taking the arrangement sequence number of the target latest change record in the change record log as the current tracing sequence number corresponding to the target latest change record, the target latest change record including the corresponding current tracing sequence number and the corresponding forward tracing sequence number is obtained.

4. The method according to claim 1, characterized in that: After obtaining the first target traceability change record matching the first target traceability sequence number in the change record log, the method further includes: In the first target traceability change record, the target change order corresponding to the current change operation is obtained; the change order is used to represent the arrangement order of different change operations; A plurality of third target retroactive change records matching the target change sequence are obtained; the plurality of third target retroactive change records represent change records respectively corresponding to different data rows acted upon by change operations of the same change sequence.

5. The method according to claim 1, characterized in that The traversing each forward tracing change record corresponding to the first target data row identifier based on the target forward tracing change record includes: If the traced forward tracing change record is stored in an archive file, then according to the target current tracing sequence number corresponding to the traced forward tracing change record, a target archive file matching the target current tracing sequence number is obtained; each archive file includes the same number of change record logs, and each change record log in the archive file includes the same number of change records; In the target archive file, a target change record log matching the target current traceability sequence number is obtained; In the target change record log, a forward tracing change record matching the target current tracing sequence number is obtained.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Store the change records in the current change record log according to the corresponding sequence numbers, and if the number of change records stored in the current change record log meets the first threshold condition, store the change records after the stored change records in a new change record log; If the number of existing change record logs meets the second threshold condition, a preset number of change record logs are retained, and the remaining change record logs are stored in the current archive file; If the number of change record logs stored in the current archive file meets the third threshold condition, the change record logs subsequent to the stored change record logs are stored in the new archive file.

7. A data tracing device, characterized in that: The device comprises: an acquisition module, configured to acquire a first target data row identifier corresponding to a data row to be traced in a database table, and acquire a first target traceability sequence number corresponding to the first target data row identifier in a change record log based on the first target data row identifier; a matching module, configured to obtain, from the change record log, a first target traceability change record that matches the first target traceability sequence number, and obtain a forward traceability sequence number corresponding to the first target traceability change record; the current traceability sequence number corresponding to the first target traceability change record matches the first target traceability sequence number; a tracing module, configured to obtain, in the change record log, a matching target forward tracing change record based on a forward tracing sequence number corresponding to the first target tracing change record, and traverse each forward tracing change record corresponding to the first target data row identifier based on the target forward tracing change record until tracing back to an initial change record corresponding to the first target data row identifier; and the forward tracing sequence number corresponding to the first target tracing change record matches the current tracing sequence number corresponding to the target forward tracing change record.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Data version management method and device and storage medium

    CN112363997A

  • Data tracing method and system and related equipment

    CN117314474A

  • Replicating data changes using multiple storage devices and tracking records of pending data changes stored on the storage devices

    US20220284033A1