A method for processing transaction logs, a storage medium and a device
Patent Information
- Application Number
- CN202211091349.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-09-07
AI Technical Summary
对于KES数据库集群内的XLOG日志的解密,采用现有的XLOG日志加密方法可以从系统文件中直接获取到XLOG日志密钥的密文,并在对其解密后获得XLOG日志密钥的明文,以用于对待解密的XLOG日志进行解密;而对于KES数据库集群外的XLOG日志的解密,采用现有的XLOG日志加密方法,将无法直接获取到XLOG日志密钥,造成了XLOG日志密钥获取困难、XLOG日志解密不便的问题,严重影响了XLOG日志的解密速度和准确性
[0039]本发明的事务日志的处理方法,通过在事务日志的写流程,以预设的加密方式加密用于加密事务日志的事务日志密钥,得到事务日志密钥的密文,并在确定事务日志需要加密的情况下,将事务日志密钥的密文存储在事务日志中,以使已加密的事务日志随身携带有事务日志密钥的密文,满足了在数据库集群内和集群外均能获取到事务日志密钥,以便对待解密的事务日志进行解密操作。
Smart Images

Figure CN117708839B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to database technology, and in particular to a method, storage medium, and device for processing transaction logs. Background Technology
[0002] In the KingbaseES database (KES database for short), the transaction log actually refers to the XLOG log (or WAL log). The database system records all update operations performed by all transactions on the KES database and writes them to the XLOG log file before they are applied. If the XLOG log in the KES database is not encrypted, unauthorized personnel who obtain XLOG logs containing sensitive user data can easily obtain sensitive user data through simple XLOG log replay operations, leading to user information leakage. Therefore, to prevent user information leakage from the XLOG log, the XLOG log needs to be encrypted with an XLOG log key to protect user information.
[0003] However, existing XLOG log encryption methods encrypt the XLOG log key using a preset encryption algorithm and store the ciphertext of the XLOG log key in a system file. For decrypting XLOG logs within a KES database cluster, these existing methods can directly retrieve the ciphertext of the XLOG log key from the system file and then decrypt it to obtain the plaintext XLOG log key, which can then be used to decrypt the XLOG log to be decrypted. However, for decrypting XLOG logs outside the KES database cluster, existing methods cannot directly obtain the XLOG log key, leading to difficulties in obtaining the XLOG log key and inconvenience in XLOG log decryption, severely impacting the decryption speed and accuracy.
[0004] Therefore, designing a KES database XLOG log processing method that can decrypt XLOG logs both inside and outside the KES database cluster has become an urgent problem to be solved. Summary of the Invention
[0005] One objective of this invention is to provide a method for processing transaction logs that can obtain the transaction log key both inside and outside the database cluster, so as to perform decryption operations on the transaction logs to be decrypted.
[0006] A further objective of this invention is to improve the ease of obtaining transaction log keys, thereby increasing the processing speed of decryption operations.
[0007] Another further objective of this invention is to improve the accuracy of obtaining transaction log keys, thereby improving the accuracy of decryption operations.
[0008] Specifically, the present invention provides a method for processing transaction logs, comprising:
[0009] During the write process of the transaction log, the transaction log key used to encrypt the transaction log is encrypted using a preset encryption method to obtain the ciphertext of the transaction log key.
[0010] If it is determined that the transaction log needs to be encrypted, the ciphertext of the transaction log key is stored in the transaction log, and the transaction log is encrypted using the transaction log key.
[0011] Optionally, the transaction log includes a transaction log header and a transaction log data area. The transaction log header, if it is determined that the transaction log needs to be encrypted, includes a first data area for storing the ciphertext of the transaction log key. This first data area does not need to be encrypted when the transaction log is encrypted.
[0012] The process of storing the encrypted transaction log key in the transaction log includes:
[0013] The ciphertext of the transaction log key is stored in the first data area.
[0014] Optionally, the transaction log data area includes multiple block data areas and a main data area. The transaction log header includes an XLogRecord structure, header data for each block data area, and header data for the main data area. If it is determined that the transaction log needs to be encrypted, the transaction log header includes a second data area for storing a preset transaction log encryption flag.
[0015] The second data region and the first data region are arranged sequentially after the XLogRecord structure.
[0016] Optionally, the process of encrypting the transaction log key used to encrypt the transaction log using a preset encryption method includes:
[0017] Obtain the preset level 1 key;
[0018] The transaction log key is encrypted using a first-level key.
[0019] Optionally, after the step of encrypting the transaction log using the transaction log key, the method further includes:
[0020] Determine whether the transaction log needs to be decrypted.
[0021] If so, obtain the first-level key;
[0022] Retrieve the ciphertext of the transaction log key from the transaction log;
[0023] The ciphertext of the transaction log key is decrypted using the first-level key to obtain the plaintext of the transaction log key.
[0024] Decrypt the transaction log using the plaintext of the transaction log key.
[0025] Optionally, in the transaction log writing process, before the step of encrypting the transaction log key used to encrypt the transaction log in a preset encryption method, the following steps are also included:
[0026] When executing the database system initialization dataset cluster command, determine whether a first-level key has been set;
[0027] If so, enable the transaction log encryption function and generate a transaction log key.
[0028] Optionally, after determining whether a first-level key has been set, the method further includes:
[0029] Without setting a primary key, the transaction log encryption function is not enabled, and the encryption operation is skipped.
[0030] Optionally, after obtaining the ciphertext of the transaction log key, the method further includes:
[0031] If it is determined that the transaction log needs to be encrypted, the ciphertext of the transaction log key is stored in the transaction log key file; and
[0032] After encrypting the transaction log using the transaction log key, the transaction log processing methods also include:
[0033] When the database system starts up, determine whether the transaction log encryption function is enabled;
[0034] If so, obtain the first-level key;
[0035] Retrieve the ciphertext of the transaction log key from the transaction log key file;
[0036] The ciphertext of the transaction log key is decrypted using the preset level-one key to obtain the plaintext of the transaction log key.
[0037] According to another aspect of the present invention, a machine-readable storage medium is also provided, on which a machine-executable program is stored, which, when executed by a processor, implements the transaction log processing method described above.
[0038] According to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a machine-executable program stored in the memory and running on the processor, wherein the processor executes the machine-executable program to implement the transaction log processing method of any of the above.
[0039] The transaction log processing method of the present invention encrypts the transaction log key used for encrypting the transaction log in a preset encryption method during the transaction log writing process to obtain the ciphertext of the transaction log key. When it is determined that the transaction log needs to be encrypted, the ciphertext of the transaction log key is stored in the transaction log, so that the encrypted transaction log carries the ciphertext of the transaction log key with it. This satisfies the requirement that the transaction log key can be obtained both inside and outside the database cluster, so as to perform decryption operations on the transaction log to be decrypted.
[0040] Furthermore, in the transaction log processing method of the present invention, the transaction log includes a transaction log header and a transaction log data area. The transaction log header, when it is determined that the transaction log needs to be encrypted, includes a first data area for storing the ciphertext of the transaction log key. This first data area does not need to be encrypted during the encryption operation of the transaction log. Additionally, by storing the ciphertext of the transaction log key in the first data area, the transaction log processing method of the present invention ensures that the ciphertext of the transaction log key is stored in a location within the transaction log that will not be encrypted again by the transaction log key. This allows for a single decryption operation in subsequent decryption processes, improving the convenience of obtaining the transaction log key and thus increasing the processing speed of the decryption operation.
[0041] Furthermore, the transaction log processing method of the present invention includes a transaction log data area comprising multiple block data areas and a main data area. The transaction log header includes an XLogRecord structure, header data for each block data area, and header data for the main data area. When it is determined that the transaction log needs to be encrypted, a second data area is added to the transaction log header to store a preset transaction log encryption flag. The second data area and the first data area are sequentially arranged after the XLogRecord structure. The transaction log processing method of the present invention further defines the storage location of the ciphertext of the transaction log key, placing it in a fixed position within the XLOG log, thereby improving the accuracy of obtaining the transaction log key and thus improving the accuracy of the decryption operation.
[0042] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description
[0043] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:
[0044] Figure 1 This is a flowchart illustrating a transaction log processing method according to an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of the structure of a transaction log in a transaction log processing method according to an embodiment of the present invention;
[0046] Figure 3 This is a schematic diagram of the structure of a transaction log in a transaction log processing method according to another embodiment of the present invention;
[0047] Figure 4 This is a schematic diagram of the structure of a transaction log in a transaction log processing method according to another embodiment of the present invention;
[0048] Figure 5 This is a flowchart illustrating a transaction log processing method according to another embodiment of the present invention;
[0049] Figure 6 This is a flowchart illustrating a transaction log processing method according to yet another embodiment of the present invention;
[0050] Figure 7 This is a schematic diagram of the structure of a machine-readable storage medium according to an embodiment of the present invention; and
[0051] Figure 8 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0052] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0053] To address the aforementioned technical problems, this invention proposes a method for processing transaction logs. Figure 1 This is a schematic flowchart illustrating a transaction log processing method according to an embodiment of the present invention. The transaction log processing method generally includes:
[0054] Step S102: In the transaction log writing process, the transaction log key used to encrypt the transaction log is encrypted using a preset encryption method to obtain the ciphertext of the transaction log key.
[0055] Step S104: If it is determined that the transaction log needs to be encrypted, the ciphertext of the transaction log key is stored in the transaction log, and the transaction log is encrypted using the transaction log key.
[0056] The transaction log processing method in this embodiment encrypts the transaction log key used for encrypting the transaction log using a preset encryption method during the transaction log writing process, obtaining the ciphertext of the transaction log key. When it is determined that the transaction log needs to be encrypted, the ciphertext of the transaction log key is stored in the transaction log, so that the encrypted transaction log carries the ciphertext of the transaction log key with it. This satisfies the requirement that the transaction log key can be obtained both inside and outside the database cluster, so as to perform decryption operations on the transaction log to be decrypted.
[0057] In one embodiment, before encrypting the transaction log key used for encrypting the transaction log in a preset encryption method in step S102 above, the transaction log processing method of the present invention may further include the following steps: when executing the database system initialization dataset cluster command, determine whether a first-level key has been set; if yes, enable the transaction log encryption function and generate a transaction log key; if no, the transaction log encryption function cannot be enabled and the encryption operation is skipped.
[0058] Specifically, KingbaseES refers to the KingbaseES database management system, a general-purpose relational database management system. Those skilled in the art will recognize that, in some optional embodiments, the transaction log encryption method of the present invention can be applied to the KES database, and in other optional embodiments, the transaction log encryption method of the present invention can also be applied to other relational databases.
[0059] For the KES database, the transaction log actually refers to the XLOG log (or WAL log). In other words, the XLOG log is the transaction log mentioned in traditional database theory, which records in detail the service process's operations on the database. Based on this, the steps to enable transaction log encryption and generate transaction log keys can be specifically executed as follows: when the XLOG log encryption function is enabled, a random XLOG log key is generated when the KES database system initializes the dataset cluster (initdb).
[0060] Based on this, the step of encrypting the transaction log key used to encrypt the transaction log in the preset encryption method in step S102 above may include the following steps: obtaining a preset first-level key; encrypting the XLOG log key using the first-level key.
[0061] The transaction log processing method in this embodiment encrypts the XLOG log key with a preset first-level key, thereby ensuring that the XLOG log key can be obtained both inside and outside the database cluster, while preventing the plaintext of the XLOG log key from being obtained directly without the first-level key, thus improving the security of the XLOG log key.
[0062] In some embodiments, after obtaining the ciphertext of the transaction log key in step S102 above, the transaction log processing method of the present invention may further include the following step: if it is determined that the XLOG log needs to be encrypted, the ciphertext of the XLOG log key is stored in the XLOG log key file. That is, in this embodiment, the KES database system, when it is determined that the XLOG log needs to be encrypted, stores the ciphertext of the XLOG log key both in the XLOG log and in the XLOG log key file.
[0063] When starting the XLOG log read process in the same KES database system, the transaction log processing method of the present invention may further include the following steps: when the KES database system starts, determine whether the XLOG log encryption function is enabled; if so, obtain the first-level key; obtain the ciphertext of the XLOG log key from the XLOG log key file; use the preset first-level key to decrypt the ciphertext of the XLOG log key to obtain the plaintext of the XLOG log key.
[0064] The transaction log processing method in this embodiment stores the encrypted XLOG log key in the XLOG log key file, which enables convenient and quick acquisition of the XLOG log key every time the XLOG log read process is started in the KES database cluster, thereby improving the processing speed of decryption operations.
[0065] When starting the XLOG log reading process in an environment outside the KES database system cluster using offline XLOG tools, the transaction log processing method of the present invention may further include the following steps: determining whether the XLOG log needs to be decrypted; if not, skipping the decryption operation; if so, obtaining the first-level key; obtaining the ciphertext of the XLOG log key from the XLOG log; using the first-level key to decrypt the ciphertext of the XLOG log key to obtain the plaintext of the XLOG log key; and using the plaintext of the XLOG log key to decrypt the XLOG log.
[0066] The transaction log processing method in this embodiment stores the encrypted XLOG log key in the XLOG log, which ensures that the XLOG log key can be obtained every time the XLOG log read process is started outside the KES database cluster, thus guaranteeing the smooth progress of the decryption operation.
[0067] The following is combined with Figures 2-4 The storage location of the ciphertext of the XLOG log key will be further explained.
[0068] Figure 2 This is a schematic diagram of the structure of a transaction log in a transaction log processing method according to an embodiment of the present invention. Figure 2As shown, in this embodiment, the XLOG log generally includes an XLOG log header and an XLOG log data area.
[0069] The XLOG log data area records user data, therefore, the XLOG log data area needs to be encrypted. However, the XLOG log header does not contain user data, therefore, the XLOG log header does not need to be encrypted. Specifically, the XLOG log data area includes multiple block data areas and a main data area. The XLOG log header includes an XLogRecord structure, header data for each block data area, and header data for the main data area. The XLogRecord structure can record data information such as the total length of the XLOG log, the transaction ID that generated this XLOG log, the position of the previous XLOG log, the XLOG log type, and the CRC checksum.
[0070] In one specific embodiment, since the XLOG log header does not need to be encrypted, the ciphertext of the XLOG log in this invention can be set in the XLOG log header. This enables the subsequent XLOG log reading process to directly obtain the ciphertext of the XLOG log without decryption again, thereby improving the decryption speed and further enhancing the overall performance of the database.
[0071] Figure 3 A schematic diagram of the structure of a transaction log in a transaction log processing method according to another embodiment of the present invention. In this embodiment, as shown... Figure 3 As shown, a space of a preset length is added after the XLogRecord structure in the XLOG log header.
[0072] When the XLOG log is encrypted, a space of a preset length is added after the XLogRecord structure in the XLOG log header, and a preset XLOG log encryption flag is recorded within this space. Specifically, the preset XLOG log encryption flag can be a pre-set value, and the aforementioned preset length is the same as the space length required to store this pre-set value.
[0073] When the XLOG log is unencrypted, the space following the XLogRecord structure of a preset length contains data that differs from the preset XLOG log encryption flag. For example, with a preset length of one byte, for an unencrypted XLOG log, the data in the space following the XLogRecord structure in the XLOG log header can be one of 1 to 32, 255, 254, or 253. Specifically, if the next byte of the XLogRecord structure is the header data of the block data area, the data therein can be the block ID, which includes any number from 1 to 32; if the length of the main data area of the XLOG log is less than or equal to 255, the data therein is 255; if the length of the main data area of the XLOG log is greater than 255, the data therein is 254; and if the XLOG log records a replication source, the data therein is 253.
[0074] Based on this, the preset XLOG log encryption flag can be selected as a value different from the above values. For example, such as Figure 3 As shown, the default XLOG log encryption flag can be set to 252.
[0075] In some embodiments, the step of determining whether the XLOG log needs to be decrypted may include the following steps: obtaining the data within one byte after the XLogRecord structure of the XLOG log; determining whether the data within one byte is the same as the preset XLOG log encryption flag; if they are the same, determining that the XLOG log needs to be decrypted; if they are not the same, determining that the XLOG log does not need to be decrypted.
[0076] The transaction log processing method in this embodiment distinguishes between encrypted and unencrypted XLOG logs conveniently and accurately by checking whether the byte following the XLogRecord structure of the XLOG log contains an XLOG log encryption flag. Furthermore, an encrypted XLOG log entry only requires an additional byte to store the encryption flag, resulting in a small space footprint. Additionally, unencrypted XLOG logs do not require an encryption flag, ensuring consistency between unencrypted and older versions of XLOG logs and avoiding compatibility issues. This allows for normal database upgrades from older versions to versions with encrypted XLOG logs.
[0077] Figure 4This is a schematic diagram of the structure of a transaction log in a transaction log processing method according to another embodiment of the present invention. For ease of explanation, the storage area in the encrypted XLOG log that records the ciphertext of the XLOG log key is designated as the first data area, and the storage area in the encrypted XLOG log that records the XLOG log encryption mark is designated as the second data area in the first data area. Figure 4 As shown, the second data region and the first data region are arranged sequentially after the XLogRecord structure.
[0078] In this embodiment, after the second data area containing the XLOG log encryption marker in the XLOG log header, a first data area is added as a storage area for the ciphertext of the XLOG log key. The length of the first data area is the same as the length of the ciphertext of the XLOG log key. In one specific embodiment, the length of the ciphertext of the XLOG log key can be 16 bytes; therefore, the length of the first data area is also set to 16 bytes.
[0079] The transaction log processing method in this embodiment stores the ciphertext of the XLOG log key after the XLOG log encryption tag, thereby enabling rapid retrieval of the XLOG log key of the encrypted XLOG log and improving the processing speed of subsequent decryption operations.
[0080] Figure 5 This is a flowchart illustrating a transaction log processing method according to another embodiment of the present invention. The following is in conjunction with... Figure 5 The process steps of this embodiment will be described in detail.
[0081] Step S502: Start the XLOG tool. It should be noted that the XLOG tool is an offline tool that reads XLOG logs outside the KES database cluster.
[0082] Step S504: In response to the input operation of the primary key, obtain the primary key.
[0083] Step S506: Obtain the ciphertext of the XLOG log key from the XLOG log. It should be noted that the ciphertext of the XLOG log key is pre-stored in the XLOG log during the pre-write process of this XLOG log entry.
[0084] Step S508: Use the first-level key to decrypt the ciphertext of the XLOG log key to obtain the plaintext of the XLOG log key.
[0085] Step S510: Decrypt the XLOG log using the plaintext of the XLOG log key. This completes the decryption operation of the XLOG log using the XLOG tool, ending this process.
[0086] The transaction log processing method in this embodiment can also directly obtain the ciphertext of the XLOG log key from the XLOG log when the XLOG tool starts the XLOG log reading process. This can satisfy the requirement of obtaining the XLOG log key outside the database cluster so as to successfully complete the decryption operation of the XLOG log to be decrypted.
[0087] Figure 6 This is a flowchart illustrating a transaction log processing method according to yet another embodiment of the present invention. The following is in conjunction with... Figure 6 The process steps of this embodiment will be described in detail.
[0088] Step S602: The database system starts. It should be noted that in some embodiments, the database system may be a KES database system.
[0089] Step S604: Determine whether the XLOG log encryption function is enabled. If yes, proceed to step S606; otherwise, proceed to step S614.
[0090] Step S606: In response to the input operation of the primary key, obtain the primary key.
[0091] Step S608: Obtain the ciphertext of the XLOG log key from the XLOG log key file. It should be noted that the ciphertext of the XLOG log key is pre-stored in the XLOG log key file during the pre-write process of this XLOG log entry.
[0092] Step S610: Use the first-level key to decrypt the ciphertext of the XLOG log key to obtain the plaintext of the XLOG log key.
[0093] Step S612: Decrypt the XLOG log using the plaintext of the XLOG log key. This completes the decryption operation of the XLOG log using the XLOG tool, ending this process.
[0094] Step S614: Skip the decryption operation; this process ends.
[0095] The transaction log processing method in this embodiment can directly obtain the ciphertext of the XLOG log key from the XLOG log key file when starting the XLOG log read process in the KES database cluster. This satisfies the requirement of successfully obtaining the XLOG log key in the database cluster and ensures the smooth progress of the decryption operation.
[0096] This embodiment also provides a machine-readable storage medium and a computer device. Figure 7 This is a schematic diagram of the structure of a machine-readable storage medium 10 according to an embodiment of the present invention. Figure 8This is a schematic diagram of the structure of a computer device 20 according to an embodiment of the present invention.
[0097] The machine-readable storage medium 10 stores a machine-executable program 11 thereon, which, when executed by a processor, implements the processing method of any of the above embodiments.
[0098] The computer device 20 may include a memory 220, a processor 210, and a machine-executable program 11 stored on the memory 220 and running on the processor 210, and the processor 210 implements the processing method of any of the above embodiments when executing the machine-executable program 11.
[0099] The flowchart provided in this embodiment is not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the method in this embodiment, additional variations can be made to the above method.
[0100] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.
Claims
1. A method for processing transaction logs, wherein, The transaction log includes a transaction log header and a transaction log data area. The transaction log header, when it is determined that the transaction log needs to be encrypted, includes a first data area for storing the ciphertext of the transaction log key. This first data area does not need to be encrypted when the transaction log is encrypted. The transaction log processing method includes: In the write process of the transaction log, the transaction log key used to encrypt the transaction log is encrypted using a preset encryption method to obtain the ciphertext of the transaction log key; If it is determined that the transaction log needs to be encrypted, the ciphertext of the transaction log key is stored in the first data area, and the transaction log is encrypted using the transaction log key.
2. The transaction log processing method according to claim 1, wherein, The transaction log data area includes multiple block data areas and a main data area. The transaction log header includes an XLogRecord structure, header data for each of the block data areas, and header data for the main data area. When it is determined that the transaction log needs to be encrypted, the transaction log header includes a second data area for storing a preset transaction log encryption flag. The second data area and the first data area are arranged sequentially after the XLogRecord structure.
3. The transaction log processing method according to claim 1, wherein, The process of encrypting the transaction log key used to encrypt the transaction log using a preset encryption method includes: Obtain the preset level 1 key; The transaction log key is encrypted using the first-level key.
4. The transaction log processing method according to claim 3, wherein, After the step of encrypting the transaction log using the transaction log key, the method further includes: Determine whether the transaction log needs to be decrypted; If so, then obtain the first-level key; Obtain the ciphertext of the transaction log key from the transaction log; The ciphertext of the transaction log key is decrypted using the first-level key to obtain the plaintext of the transaction log key; The transaction log is decrypted using the plaintext of the transaction log key.
5. The transaction log processing method according to claim 3, wherein, The write process of the transaction log, before the step of encrypting the transaction log key used to encrypt the transaction log in a preset encryption method, further includes: When executing the database system initialization dataset cluster command, determine whether the first-level key has been set; If so, then enable the transaction log encryption function and generate the transaction log key.
6. The transaction log processing method according to claim 5, wherein, After the step of determining whether the first-level key has been set, the method further includes: Without setting the primary key, the transaction log encryption function is not enabled, and the encryption operation is skipped.
7. The transaction log processing method according to claim 5, wherein, After the step of obtaining the ciphertext of the transaction log key, the method further includes: If it is determined that the transaction log needs to be encrypted, the ciphertext of the transaction log key is stored in the transaction log key file; and After the step of encrypting the transaction log using the transaction log key, the method for processing the transaction log further includes: When the database system starts, determine whether the transaction log encryption function is enabled; If so, then obtain the first-level key; Obtain the ciphertext of the transaction log key from the transaction log key file; The ciphertext of the transaction log key is decrypted using the preset first-level key to obtain the plaintext of the transaction log key.
8. A machine-readable storage medium having a machine-executable program stored thereon, the machine-executable program, when executed by a processor, implementing the transaction log processing method according to any one of claims 1 to 7.
9. A computer device comprising a memory, a processor, and a machine-executable program stored in the memory and running on the processor, wherein the processor, when executing the machine-executable program, implements the transaction log processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Log encryption method and device and log decryption method and device
CN110661748A