Bp data reading method and device, computer device and storage medium

By reading BP data in the uninitialized state of the solid-state drive controller, the problem of the inability to read BP data in the prior art is solved, and reliable reading and saving in the uninitialized state is achieved.

CN115951837BActive Publication Date: 2026-07-31SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU UNIONMEMORY INFORMATION SYST LTD
Filing Date
2023-01-17
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technology cannot correctly read BP data when the SSD controller is not initialized, resulting in an uncontrollable initialization process and an inability to assess the SSD controller's BP data reading capability.

Method used

The system determines whether the SSD supports BP by obtaining the controller function field of the controller register. After power failure, it powers on and reads the controller status field. In the uninitialized state, it reads the BP data and saves it to the buffer.

Benefits of technology

It enables the correct reading of BP data when the solid-state drive controller is not initialized, solves the problem of uncontrollable initialization process, and ensures reliable reading of BP data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115951837B_ABST
    Figure CN115951837B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, computer device, and storage medium for reading backplane (BP) data. The method includes: obtaining a controller function field from a controller register; determining whether an SSD supports BP based on the controller function field; if the SSD supports BP, obtaining a BP information field from the controller register to obtain the total BP space capacity; powering off the SSD; powering on the SSD; reading a controller status field from the controller register; when the controller status field is in an uninitialized state, reading BP data; and saving the BP data. By implementing the method of this invention, BP data can be correctly read even when the SSD controller is in an uninitialized state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to solid-state drives, and more specifically to BP data reading methods, apparatus, computer equipment, and storage media. Background Technology

[0002] The boot partition (BP) of a solid-state drive (SSD) is a storage area independent of the user-visible space. Data in this area can be read immediately after the SSD is powered on, without waiting for the NVMe (Non-Volatile Memory Express) SSD to complete the controller initialization. This fast data loading capability allows SSDs that support BP to participate in the host platform's initialization process.

[0003] The host computer's SSD initialization process involves first initializing the PCIe (Peripheral Component Interconnect Express) after power-on, followed by controller initialization. In typical usage environments, such as desktop and laptop computers, the host automatically initializes both the PCIe and SSD controller upon startup. In common testing environments, such as u-link's DriveMaster, the initialization of the PCIe and SSD controller is also automatic and inseparable when the SSD is loaded. However, in both typical usage and common testing environments, the SSD initialization process is uncontrollable, making it impossible to maintain the SSD in a specific uninitialized controller state and thus impossible to assess whether the SSD controller can correctly read data from the backplane (BP) in an uninitialized state.

[0004] Therefore, it is necessary to design a new method to enable the solid-state drive controller to correctly read BP data in an uninitialized state. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a BP data reading method, apparatus, computer equipment and storage medium.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a BP data reading method, comprising:

[0007] Retrieve the controller function fields from the controller register;

[0008] Determine whether the SSD supports BP based on the controller function fields;

[0009] If the SSD supports BP, then obtain the BP information field from the controller register to get the total capacity of the BP space;

[0010] Power off the SSD;

[0011] Power on the SSD;

[0012] Read the controller status field from the controller register;

[0013] When the control status field is in an uninitialized state, read the BP data;

[0014] Save the BP data.

[0015] The further technical solution is as follows: the method of saving the BP data includes:

[0016] Save the BP data to the buffer.

[0017] The further technical solution is as follows: when the control state field is in an uninitialized state, reading BP data includes:

[0018] When the control status field is in an uninitialized state, the BP data is read by writing to the BP read selection field of the controller register.

[0019] The further technical solution is as follows: obtaining the BP information field of the controller register to obtain the total capacity of the BP space includes:

[0020] Obtain the BP information field from the controller register to get the BP space information;

[0021] The total capacity of the BP space is determined based on the BP space information.

[0022] The further technical solution is as follows: after determining whether the SSD supports BP based on the controller function field, it also includes:

[0023] If the SSD does not support BP, proceed to the end step.

[0024] The present invention also provides a BP data reading device, comprising:

[0025] The field acquisition unit is used to acquire the controller function fields of the controller register;

[0026] The judgment unit is used to determine whether the SSD supports BP based on the controller function fields;

[0027] The information acquisition unit is used to obtain the BP information field of the controller register if the SSD supports BP, so as to obtain the total capacity of the BP space.

[0028] Power-off unit, used to power off the SSD;

[0029] The power supply unit is used to power on the SSD;

[0030] The field reading unit is used to read the controller status field from the controller register;

[0031] The data reading unit is used to read BP data when the control status field is in an uninitialized state;

[0032] A storage unit is used to store the BP data.

[0033] The further technical solution is as follows: the storage unit is used to store the BP data to the buffer.

[0034] The further technical solution is as follows: the data reading unit is used to read BP data by writing to the BP read selection field of the controller register when the control status field is in an uninitialized state.

[0035] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described method.

[0036] The present invention also provides a storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0037] The beneficial effects of this invention compared with the prior art are as follows: This invention reads the BP information field under the premise that the SSD supports BP, and after powering down and powering on the SSD, it does not execute the initialization process, reads the controller status field, and reads the BP data when the controller status is in an uninitialized state, thus enabling the SSD controller to correctly read BP data in an uninitialized state.

[0038] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a schematic diagram illustrating an application scenario of the BP data reading method provided in this embodiment of the invention;

[0041] Figure 2 This is a flowchart illustrating the BP data reading method provided in an embodiment of the present invention;

[0042] Figure 3A schematic diagram of a sub-process of the BP data reading method provided in an embodiment of the present invention;

[0043] Figure 4 A schematic block diagram of a BP data reading device provided in an embodiment of the present invention;

[0044] Figure 5 A schematic block diagram of the information acquisition unit of the BP data reading device provided in an embodiment of the present invention;

[0045] Figure 6 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0048] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0049] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0050] Please see Figure 1 and Figure 2 , Figure 1 This is a schematic diagram illustrating an application scenario of the BP data reading method provided in an embodiment of the present invention. Figure 2This is a schematic flowchart illustrating the BP data reading method provided in an embodiment of the present invention. This BP data reading method is applied in a test machine. The test machine interacts with several devices under test (DUTs). The test machine refers to a TPS (Through Processing Station) platform, a domestically produced SSD testing platform, which provides underlying general command interfaces and can test up to 64 SSDs simultaneously. It has a built-in Python 2.x version, and independently designed test cases and developed test scripts.

[0051] Figure 2 This is a flowchart illustrating the BP data reading method provided in an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S180.

[0052] S110. Obtain the controller function field of the controller register.

[0053] In this embodiment, the controller function field refers to the field that carries the relevant functions supported by the controller register.

[0054] Specifically, the relevant fields are read using the following method: capabilities = device.get_ctrl_reg_dw(offset = 0) | (device.get_ctrl_reg_dw(offset = 4) << 32); BPS = (capabilities >> 45) & 0x1; If bit 45 (BPS) is 0, it means that BP is not supported: print an alarm and exit the test.

[0055] S120. Determine whether the SSD supports BP based on the controller function fields;

[0056] If the SSD does not support BP, proceed to the end step.

[0057] S130. If the SSD supports BP, obtain the BP information field of the controller register to get the total capacity of the BP space.

[0058] In this embodiment, the total capacity of the BP space refers to the data content that can be read from the BP space.

[0059] In one embodiment, please refer to Figure 3 The above-mentioned step S130 may include steps S131 to S132.

[0060] S131. Obtain the BP information field of the controller register to get the BP space information.

[0061] In this embodiment, BP spatial information refers to Boot Partition Size (BPSZ).

[0062] S132. Determine the total capacity of the BP space based on the BP space information.

[0063] Specifically, the total capacity of the BP space represents the total size of the BP space, which is BPSZ 128KB (BPSZ*128*1024 bytes).

[0064] In this embodiment, the Boot Partition Information field of the controller register is read to obtain the Boot Partition Size (BPSZ), specifically by using bpinfo = device.get_ctrl_reg_dw(0x40);

[0065] BPSZ = bpinfo & 0x7fff is read.

[0066] S140. Power off the SSD.

[0067] In this embodiment, device.shutdown_notification(); resume = device.power_down() is used to safely power down the SSD.

[0068] S150. Power on the SSD.

[0069] In this embodiment, set_voltages(v12=None,v05=None,v03=3300,tray=TEST_ENV["tray"]) is used to power on the SSD.

[0070] After power-on, the controller initialization is not performed. Specifically, it is achieved using refresh_pci_info(); device.device_resume(do_dev_init=False,do_suspend=False,timeout=30); device.suspend().

[0071] S160, Read the controller status field of the controller register.

[0072] In this embodiment, the Controller Status field of the controller register is read to confirm that the controller is in an uninitialized state (rdy = 0); specifically, csts = device.get_ctrl_reg_dw(0x1C); rdy = csts&0x1 is implemented.

[0073] S170. When the control status field is in an uninitialized state, read the BP data.

[0074] In this embodiment, when the control status field is in an uninitialized state, the BP data is read by writing the BP read selection field of the controller register.

[0075] BP data refers to data within the BP space.

[0076] S180. Save the BP data.

[0077] In this embodiment, the BP data is saved to a buffer.

[0078] Reading BP data is achieved by writing to the Boot Partition Read Select field of the controller register. This process checks for successful command execution, reads the data, saves it to the buffer, and determines if it matches expectations. Specifically, it uses `device.device.bp_read_4k(offset, size, bpid, buffer, timeout = timeout); buffer.compare(origin_data, BPSZ * 128 * 1024, buffer_offset = 0x0)`. A single data read does not exceed 4MB, and the total size does not exceed the BPSZ * 128KB obtained in the second step.

[0079] The above-described BP data reading method reads the BP information field by powering off and then powering on the SSD without executing the initialization process, and reads the controller status field. It ensures that the controller status is uninitialized before reading the BP data, thus enabling the SSD controller to correctly read BP data in an uninitialized state.

[0080] Figure 4 This is a schematic block diagram of a BP data reading device 300 provided in an embodiment of the present invention. Figure 4 As shown, corresponding to the above-described BP data reading method, the present invention also provides a BP data reading device 300. This BP data reading device 300 includes a unit for performing the above-described BP data reading method, and the device can be configured in a server. Specifically, please refer to... Figure 4 The BP data reading device 300 includes a field acquisition unit 301, a judgment unit 302, an information acquisition unit 303, a power-off unit 304, a power-on unit 305, a field reading unit 306, a data reading unit 307, and a storage unit 308.

[0081] The field acquisition unit 301 is used to acquire the controller function field of the controller register; the judgment unit 302 is used to determine whether the SSD supports BP based on the controller function field; if the SSD does not support BP, the process proceeds to the end step. The information acquisition unit 303 is used to acquire the BP information field of the controller register if the SSD supports BP, so as to obtain the total BP space capacity; the power-off unit 304 is used to power off the SSD; the power-on unit 305 is used to power on the SSD; the field reading unit 306 is used to read the controller status field of the controller register; the data reading unit 307 is used to read BP data when the control status field is in an uninitialized state; and the storage unit 308 is used to store the BP data.

[0082] In one embodiment, the storage unit 308 is used to store the BP data to a buffer.

[0083] In one embodiment, the data reading unit 307 is used to read BP data by writing to the BP read selection field of the controller register when the control state field is in an uninitialized state.

[0084] In one embodiment, such as Figure 5 As shown, the information acquisition unit 303 includes an acquisition subunit 3031 and a determination subunit 3032.

[0085] The acquisition subunit 3031 is used to acquire the BP information field of the controller register to obtain the BP space information; the determination subunit 3032 is used to determine the total capacity of the BP space based on the BP space information.

[0086] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned BP data reading device 300 and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0087] The aforementioned BP data reading device 300 can be implemented as a computer program, which can, for example... Figure 6 It runs on the computer device shown.

[0088] Please see Figure 6 , Figure 6 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.

[0089] See Figure 6The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0090] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a BP data reading method.

[0091] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0092] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a BP data reading method.

[0093] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 6 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 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0094] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps:

[0095] Obtain the controller function field of the controller register; determine whether the SSD supports BP based on the controller function field; if the SSD supports BP, obtain the BP information field of the controller register to obtain the total BP space capacity; power off the SSD; power on the SSD; read the controller status field of the controller register; when the control status field is in an uninitialized state, read the BP data; save the BP data.

[0096] In one embodiment, when implementing the step of saving the BP data, the processor 502 specifically implements the following steps:

[0097] Save the BP data to the buffer.

[0098] In one embodiment, when the processor 502 implements the step of reading BP data when the control state field is in an uninitialized state, the specific steps are as follows:

[0099] When the control status field is in an uninitialized state, the BP data is read by writing to the BP read selection field of the controller register.

[0100] In one embodiment, when the processor 502 implements the step of obtaining the BP information field of the controller register to obtain the total capacity of the BP space, the following steps are specifically implemented:

[0101] Obtain the BP information field from the controller register to obtain the BP space information; determine the total capacity of the BP space based on the BP space information.

[0102] In one embodiment, after determining whether the SSD supports BP based on the controller function field, the processor 502 further implements the following steps:

[0103] If the SSD does not support BP, proceed to the end step.

[0104] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0105] It will be understood by those skilled in the art 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 includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0106] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein when executed by a processor, the computer program causes the processor to perform the following steps:

[0107] Obtain the controller function field of the controller register; determine whether the SSD supports BP based on the controller function field; if the SSD supports BP, obtain the BP information field of the controller register to obtain the total BP space capacity; power off the SSD; power on the SSD; read the controller status field of the controller register; when the control status field is in an uninitialized state, read the BP data; save the BP data.

[0108] In one embodiment, when the processor executes the computer program to implement the step of saving the BP data, it specifically implements the following steps:

[0109] Save the BP data to the buffer.

[0110] In one embodiment, when the processor executes the computer program to implement the step of reading BP data when the control state field is in an uninitialized state, it specifically implements the following steps:

[0111] When the control status field is in an uninitialized state, the BP data is read by writing to the BP read selection field of the controller register.

[0112] In one embodiment, when the processor executes the computer program to obtain the BP information field of the controller register to obtain the total capacity of the BP space, it specifically implements the following steps:

[0113] Obtain the BP information field from the controller register to obtain the BP space information; determine the total capacity of the BP space based on the BP space information.

[0114] In one embodiment, after executing the computer program to determine whether the SSD supports BP based on the controller function field, the processor further implements the following steps:

[0115] If the SSD does not support BP, proceed to the end step.

[0116] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0117] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0118] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0119] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0120] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0121] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for reading BP data, wherein BP is the boot partition of a solid-state drive, characterized in that, The methods include: Retrieve the controller function fields from the controller register; Determine whether the SSD supports BP based on the controller function fields; If the SSD supports BP, then obtain the BP information field from the controller register to get the total capacity of the BP space; Power off the SSD; Power on the SSD again after a power outage; Read the controller status field from the controller register; When the controller status field is in an uninitialized state, read the BP data; Save the BP data.

2. The BP data reading method according to claim 1, characterized in that, The process of saving the BP data includes: Save the BP data to the buffer.

3. The BP data reading method according to claim 1, characterized in that, When the controller status field is in an uninitialized state, reading BP data includes: When the controller status field is in an uninitialized state, the BP data is read by writing to the BP read selection field of the controller register.

4. The BP data reading method according to claim 1, characterized in that, The step of obtaining the BP information field of the controller register to obtain the total capacity of the BP space includes: Obtain the BP information field from the controller register to get the BP space information; The total capacity of the BP space is determined based on the BP space information.

5. The BP data reading method according to claim 1, characterized in that, After determining whether the SSD supports BP based on the controller function fields, the process also includes: If the SSD does not support BP, proceed to the end step.

6. A BP data reading device, wherein the BP is the boot partition of a solid-state drive, characterized in that, The device includes: The field acquisition unit is used to acquire the controller function fields of the controller register; The judgment unit is used to determine whether the SSD supports BP based on the controller function fields; The information acquisition unit is used to obtain the BP information field of the controller register if the SSD supports BP, so as to obtain the total capacity of the BP space. Power-off unit, used to power off the SSD; The power-on unit is used to re-power the SSD after a power outage; The field reading unit is used to read the controller status field from the controller register; The data reading unit is used to read BP data when the controller status field is in an uninitialized state; A storage unit is used to store the BP data.

7. The BP data reading device according to claim 6, characterized in that, The storage unit is used to store the BP data to the buffer.

8. The BP data reading device according to claim 6, characterized in that, The data reading unit is used to read BP data by writing to the BP read selection field of the controller register when the controller status field is in an uninitialized state.

9. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 5.

10. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 5.