Transaction function implementation method and device applied to ssd tgc module

By creating two SP data spaces within the SSD TCG module, updating the first SP data only within a Transaction, and restoring and copying it upon termination, the issue of missing Transaction functionality is resolved, thus improving data security and integrity.

CN117785054BActive Publication Date: 2026-06-19SUZHOU UNIONMEMORY INFORMATION SYST LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU UNIONMEMORY INFORMATION SYST LTD
Filing Date
2023-12-28
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The lack of a complete implementation scheme for the SSD TCG module Transaction function in existing technologies leads to insufficient data security.

Method used

Two spaces are allocated in the non-user data area to store two identical SP data. Only the first SP data is updated within the Transaction. When the Transaction is terminated, the first SP data is restored using the second SP data, and the changes are copied to the second SP data when the transaction is closed.

Benefits of technology

It ensures the integrity and data security of the Transaction function, guarantees that changes can be rolled back when a Transaction is aborted, and improves the data security of SSDs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117785054B_ABST
    Figure CN117785054B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, and storage medium for implementing the Transaction function in an SSD TCG module. The method includes: allocating two spaces within a non-user data area to store two identical SP data sets, including a first SP data set and a second SP data set; updating only the first SP data set when modifications occur within the Transaction; restoring the first SP data set and the local SP data using the second SP data set when the Transaction is terminated; and immediately applying the changes to the first SP data set when the Transaction is closed, and copying the first SP data set to the second SP data set. This invention improves the functionality of the TCG module, implements the Transaction function, and allows for the rollback of changes when a Transaction is terminated while it is in progress.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of solid-state drive technology, and in particular to a method, apparatus, computer device, and storage medium for implementing the Transaction function in an SSD TCG module. Background Technology

[0002] Solid-state drives (SSDs) have been widely used in various applications and are gradually replacing traditional HDDs in the PC market, providing users with a better experience in terms of reliability and performance. With the increasing popularity of SSD products, more and more SSD products are required to support TCG (Thin-State Delivery Code) functionality to enhance the security of SSD data.

[0003] Within the TCG module, the Transaction function provides a convenient and simple way to modify and apply changes to the SP (Service Provider), and also a convenient way to handle error behavior. However, traditional technical solutions do not offer a complete technical solution for implementing the Transaction function in the SSD TCG module. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, and storage medium for implementing the Transaction function in an SSD TCG module to address the aforementioned technical problems.

[0005] A method for implementing the Transaction function in an SSD TCG module, the method comprising:

[0006] Two spaces are allocated within the non-user data area to store two identical SP data sets, including the first SP data and the second SP data.

[0007] When changes occur within a transaction, only the first SP data is updated;

[0008] When a transaction is aborted, the first SP data and local SP data are recovered using the second SP data;

[0009] When the transaction is closed, the changes to the first SP data take effect immediately and the first SP data is copied to the second SP data.

[0010] In one embodiment, the method further includes:

[0011] Enable the Transaction function, execute the TCG command and update the SP table;

[0012] Update local SP data and first SP data according to TCG cmd.

[0013] In one embodiment, the step of updating the local SP data and the first SP data according to the TCG cmd further includes:

[0014] When the TCG module receives the abort cmd, it uses the second SP data to restore the first SP data and restores the local SP data, thus successfully rolling back.

[0015] In one embodiment, the step of updating the local SP data and the first SP data according to the TCG cmd further includes:

[0016] When the TCG module receives the End transaction cmd, it copies the updated first SP data to the second SP data to make the two SP data consistent.

[0017] An apparatus for implementing the Transaction function in an SSD TCG module, the apparatus comprising:

[0018] The data storage module allocates two spaces in the non-user data area to store two identical SP data, including the first SP data and the second SP data.

[0019] The data update module is used to update only the first SP data when changes occur within a Transaction;

[0020] The data recovery module is used to recover the first SP data and local SP data using the second SP data when the Transaction is aborted.

[0021] The data replication module is used to ensure that changes to the first SP data take effect immediately and to replicate the first SP data to the second SP data when the Transaction is closed.

[0022] In one embodiment, the data update module is further configured to:

[0023] Enable the Transaction function, execute the TCG command and update the SP table;

[0024] Update local SP data and first SP data according to TCG cmd.

[0025] In one embodiment, the data recovery module is further configured to:

[0026] When the TCG module receives the abort cmd, it uses the second SP data to restore the first SP data and restores the local SP data, thus successfully rolling back.

[0027] In one embodiment, the data replication module is further configured to:

[0028] When the TCG module receives the End transaction cmd, it copies the updated first SP data to the second SP data to make the two SP data consistent.

[0029] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0030] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0031] The aforementioned method, apparatus, computer device, and storage medium for implementing the Transaction function in an SSD TCG module allocate two spaces within the non-user data area to store two identical SP data sets, including a first SP data set and a second SP data set. When modifications occur within the Transaction, only the first SP data set is updated. When the Transaction is terminated, the first SP data set and the local SP data set are restored using the second SP data set. When the Transaction is closed, the modifications to the first SP data set take effect immediately, and the first SP data set is copied to the second SP data set. This invention improves the functionality of the TCG module, implements the Transaction function, and allows for the rollback of modifications when a Transaction is terminated while it is in progress. Attached Figure Description

[0032] Figure 1 This is a flowchart illustrating a method for implementing the Transaction function in an SSD TCG module in one embodiment.

[0033] Figure 2 This is a schematic diagram of the process of a Transaction being aborted in one embodiment;

[0034] Figure 3 This is a schematic diagram of the transaction taking effect in one embodiment;

[0035] Figure 4 This is a flowchart illustrating the implementation method of the Transaction function applied to the SSD TCG module in another embodiment;

[0036] Figure 5This is a flowchart illustrating the implementation method of the Transaction function applied to the SSD TCG module in another embodiment;

[0037] Figure 6 This is a structural block diagram of a device for implementing the Transaction function in an SSD TCG module, as shown in one embodiment.

[0038] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0040] In one embodiment, such as Figure 1 As shown, a method for implementing the Transaction function in an SSD TCG module is provided, the method including:

[0041] Step 102: Create two spaces in the non-user data area to store two identical SP data, including the first SP data and the second SP data.

[0042] Step 104: When changes occur within a Transaction, only update the data of the first SP;

[0043] Step 106: When the Transaction is aborted, use the second SP data to restore the first SP data and the local SP data;

[0044] Step 108: When the Transaction is closed, the changes to the first SP data take effect immediately and the first SP data is copied to the second SP data.

[0045] In this embodiment, a method for implementing the Transaction function applied to the SSD TCG module is provided. This method utilizes the design of dual backup of SP data. When the Transaction is opened, only one copy is updated. When the Transaction is aborted, the SP table that has not been updated is used to restore it. When the Transaction is closed, both copies of the SP table are updated.

[0046] First, two spaces are allocated in the non-user data area to store two identical SP data, including the first SP data SP_A and the second SP data SP_B.

[0047] The Transaction function is optional in the TCG module. The protocol stipulates that a Transaction must exist in an open session. When the session is aborted, the Transaction must also be aborted.

[0048] When a method is invoked outside of a transaction, the changes take effect immediately and are persisted.

[0049] When a method is called within a Transaction, it remains active until the Transaction is committed. If a Transaction is aborted, all changes made within the Transaction must be rolled back, and the SP's state must be restored to its state before the Transaction began.

[0050] Changes made to SPs within a Transaction are considered to be effective until the Transaction ends.

[0051] Specifically, refer to Figure 2 The diagram shown illustrates the process of a transaction being aborted. Changes made within a transaction only take effect on SP_A. When aborted, SP_A and the local SP are restored using SP_B.

[0052] Specifically, refer to Figure 3 The diagram shows the process of a transaction taking effect. When the transaction closes, the changes in SP_A take effect immediately and are copied to SP_B.

[0053] In this embodiment, two spaces are allocated within the non-user data area to store two identical SP data sets, namely a first SP data set and a second SP data set. When changes occur within a Transaction, only the first SP data set is updated. When a Transaction is aborted, the first SP data set and the local SP data set are restored using the second SP data set. When a Transaction is closed, changes to the first SP data set take effect immediately, and the first SP data set is copied to the second SP data set. This invention improves the functionality of the TCG module, implements the Transaction function, and allows for the rollback of changes when a Transaction is aborted while it is in progress.

[0054] In one embodiment, such as Figure 4 As shown, a method for implementing the Transaction function in an SSD TCG module is provided, which further includes:

[0055] Step 402: Enable the Transaction function, execute TCG cmd and update the SP table;

[0056] Step 404: Update the local SP data and the first SP data according to the TCG cmd;

[0057] Step 406: When the TCG module receives the abort cmd, it uses the second SP data to restore the first SP data and restores the local SP data, and the rollback is successful.

[0058] Step 408: When the TCG module receives the End transaction cmd, it copies the updated first SP data to the second SP data to make the two SP data consistent.

[0059] For specific details, please refer to Figure 5 The flowchart shown illustrates the implementation method of the Transaction function applied to the SSD TCG module. The specific implementation steps are as follows:

[0060] Step 5.1: Start the transaction.

[0061] Step 5.2: Execute TCG cmd, such as SET method, to update SPtable.

[0062] Step 5.3: Update the local SP data and update SP_A according to the TCG cmd.

[0063] Step 5.4, Case 1: The TCG module receives the abort cmd, restores SP_A using SP_B, restores the local SP, and the rollback is successful.

[0064] Step 5.5, Case 2: Upon receiving the Endtransaction cmd, use SP_A to update SP_B, and the changes will take effect.

[0065] In this embodiment, the Transaction function provides a relatively convenient and simple way to modify and make changes to the SP, and it is also a convenient way to handle erroneous behavior. In this embodiment, the changes made to the TCG SP within the Transaction can be rolled back to the version before the Transaction when the Session aborts.

[0066] It should be understood that, although Figures 1-5 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-5 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0067] In one embodiment, such as Figure 6 As shown, a Transaction function implementation device 600 for an SSD TCG module is provided, the device comprising:

[0068] Data storage module 601, wherein the data storage module opens two spaces in the non-user data area to store two identical SP data, including the first SP data and the second SP data;

[0069] Data update module 602, the data update module is used to update only the first SP data when changes occur within the Transaction;

[0070] Data recovery module 603, the data recovery module is used to recover the first SP data and local SP data using the second SP data when the Transaction is terminated;

[0071] The data replication module 604 is used to ensure that changes to the first SP data take effect immediately and to replicate the first SP data to the second SP data when the Transaction is closed.

[0072] In one embodiment, the data update module 602 is further configured to:

[0073] Enable the Transaction function, execute the TCG command and update the SP table;

[0074] Update local SP data and first SP data according to TCG cmd.

[0075] In one embodiment, the data recovery module 603 is further configured to:

[0076] When the TCG module receives the abort cmd, it uses the second SP data to restore the first SP data and restores the local SP data, thus successfully rolling back.

[0077] In one embodiment, the data replication module 604 is further configured to:

[0078] When the TCG module receives the End transaction cmd, it copies the updated first SP data to the second SP data to make the two SP data consistent.

[0079] For specific limitations on the implementation device of the Transaction function applied to the SSD TCG module, please refer to the limitations on the implementation method of the Transaction function applied to the SSD TCG module above, which will not be repeated here.

[0080] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a device bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores operating devices, computer programs, and a database. The internal memory provides an environment for the operation of the operating devices and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a Transaction function implementation method applied to an SSD TCG module.

[0081] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0082] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the various method embodiments described above.

[0083] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the various method embodiments described above.

[0084] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0085] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 specification.

[0086] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for implementing the Transaction function in an SSD TCG module, the method comprising: Two spaces are allocated within the non-user data area to store two identical SP data sets, including the first SP data and the second SP data. When changes occur within a transaction, only the first SP data is updated; When a transaction is aborted, the first SP data and local SP data are recovered using the second SP data; When the transaction is closed, the changes to the first SP data take effect immediately and the first SP data is copied to the second SP data.

2. The method for implementing the Transaction function in an SSD TCG module according to claim 1, characterized in that, The method further includes: Enable the Transaction function, execute the TCG command and update the SP table; Update local SP data and first SP data according to TCG cmd.

3. The method for implementing the Transaction function in an SSD TCG module according to claim 2, characterized in that, Following the step of updating the local SP data and the first SP data according to the TCG cmd, the following is also included: When the TCG module receives the abort cmd, it uses the second SP data to restore the first SP data and restores the local SP data, thus successfully rolling back.

4. The method for implementing the Transaction function in an SSD TCG module according to claim 3, characterized in that, Following the step of updating the local SP data and the first SP data according to the TCG cmd, the following is also included: When the TCG module receives the End transaction cmd, it copies the updated first SP data to the second SP data to make the two SP data consistent.

5. A device for implementing the Transaction function in an SSD TCG module, characterized in that, The device includes: The data storage module allocates two spaces in the non-user data area to store two identical SP data, including the first SP data and the second SP data. The data update module is used to update only the first SP data when changes occur within a Transaction; The data recovery module is used to recover the first SP data and local SP data using the second SP data when the Transaction is aborted. The data replication module is used to ensure that changes to the first SP data take effect immediately and to replicate the first SP data to the second SP data when the Transaction is closed.

6. The Transaction function implementation device applied to an SSD TCG module according to claim 5, characterized in that, The data update module is also used for: Enable the Transaction function, execute the TCG command and update the SP table; Update local SP data and first SP data according to TCG cmd.

7. The Transaction function implementation device applied to an SSD TCG module according to claim 6, characterized in that, The data recovery module is also used for: When the TCG module receives the abort cmd, it uses the second SP data to restore the first SP data and restores the local SP data, thus successfully rolling back.

8. The Transaction function implementation device applied to an SSD TCG module according to claim 7, characterized in that, The data replication module is also used for: When the TCG module receives the End transaction cmd, it copies the updated first SP data to the second SP data to make the two SP data consistent.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.