Firmware upgrade method, device, computer equipment and storage medium based on solid state drive
By multiplexing the write buffer in the write buffer of the solid state drive, some sub-buffers are temporarily released to store new firmware, which solves the problem of DRAM memory occupied by firmware upgrades and improves the overall performance of SSD.
Patent Information
- Application Number
- CN202111257337.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In the prior art, due to the large firmware file of the solid state hard disk firmware upgrade, it permanently takes up more DRAM memory space, affecting the overall performance of the SSD.
By multiplexing the write buffer in the write buffer of the solid state drive, some sub-buffers are temporarily released to store the new firmware, only one sub-buffer is retained to process the write command, and restore the original state after the upgrade is completed, reducing the use of DRAM memory.
It significantly reduces the use of DRAM memory, improves the overall performance of SSD, and frees up memory for other key programs.
Smart Images

Figure CN113986318B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage systems, and in particular to a firmware upgrade method, device, computer equipment, and storage medium based on a solid-state drive. Background Art
[0002] With the development of solid-state drive technology, SSD (Solid State Disk) has been widely used in various occasions and has gradually replaced traditional HDD (Hard Disk Drive) in the PC market, providing users with a better experience in terms of reliability and performance.
[0003] During the SSD R&D phase or after it's released, firmware upgrades are essential. The stability and cost-effectiveness of firmware upgrades are crucial. During firmware upgrades, large files are downloaded to the SSD in segments. Currently, the mainstream solution is to permanently allocate a dedicated DRAM memory space to store these segmented firmware files. This consumes a significant amount of DRAM space (ranging from 1MB to 3MB), which is constantly occupied, impacting the overall performance of the SSD. Summary of the Invention
[0004] Based on this, it is necessary to provide a firmware upgrade method, device, computer equipment and storage medium based on a solid state drive to address the above technical problems.
[0005] A method for upgrading firmware based on a solid-state drive, the method comprising:
[0006] Obtaining a firmware upgrade request based on the solid-state drive, wherein the request includes a firmware download command;
[0007] There are multiple sub-buffers in the write buffer of the solid-state drive to process write command requests in a loop. Each sub-buffer can process one write command at a time.
[0008] When the SSD receives a firmware download command, it changes the write buffer configuration parameters so that only one sub-buffer is reserved for processing the write command, and the remaining sub-buffers are freed up for storing the new firmware.
[0009] When performing a firmware upgrade, the new firmware is downloaded to the write buffer using the firmware download command;
[0010] After the firmware upgrade is completed, the configuration parameters of the write buffer are changed to restore the use of all sub-buffers to cyclically process write commands.
[0011] In one embodiment, the step of providing a plurality of sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests, wherein each sub-buffer can process one write command at a time, further includes:
[0012] There are 8 sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests. Each sub-buffer can process one write command at a time.
[0013] In one embodiment, when the solid-state drive receives a firmware download command, the step of changing the configuration parameters of the write buffer so that only one sub-buffer is reserved in the write buffer for processing the write command and the remaining sub-buffers are freed for storing the new firmware further includes:
[0014] When the SSD receives a firmware download command, it changes the write buffer configuration parameters so that only one sub-buffer is reserved for processing the write command, and the remaining seven sub-buffers are freed up for storing the new firmware.
[0015] In one embodiment, after the firmware upgrade is completed, the step of resuming the use of all sub-buffers to cyclically process write commands by changing the configuration parameters of the write buffer further includes:
[0016] After the firmware upgrade is complete, the write buffer configuration parameters are changed to restore the use of all eight sub-buffers to cyclically process write commands.
[0017] A firmware upgrade device based on a solid-state drive, the device comprising:
[0018] An acquisition module, configured to acquire a firmware upgrade request based on a solid-state drive, wherein the request includes a firmware download command;
[0019] A write command module, wherein the write command module is used to process write command requests in a loop in a plurality of sub-buffers in the write buffer of the solid-state drive, and each sub-buffer can process one write command at a time;
[0020] A multiplexing module, wherein when the solid-state drive receives a firmware download command, the multiplexing module is configured to change the configuration parameters of the write buffer so that only one sub-buffer in the write buffer is reserved for processing the write command, and the remaining sub-buffers are freed for storing new firmware;
[0021] Download module, which is used to download the new firmware to the write buffer through the firmware download command when performing firmware upgrade;
[0022] The recovery module is used to restore the use of all sub-buffers to cyclically process write commands by changing the configuration parameters of the write buffer after the firmware upgrade is completed.
[0023] In one embodiment, the write command module is further configured to:
[0024] There are 8 sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests. Each sub-buffer can process one write command at a time.
[0025] In one embodiment, the multiplexing module is further configured to:
[0026] When the SSD receives a firmware download command, it changes the write buffer configuration parameters so that only one sub-buffer is reserved for processing the write command, and the remaining seven sub-buffers are freed up for storing the new firmware.
[0027] In one embodiment, the recovery module is further configured to:
[0028] After the firmware upgrade is complete, the write buffer configuration parameters are changed to restore the use of all eight sub-buffers to cyclically process write commands.
[0029] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.
[0030] A computer-readable storage medium stores a computer program, which implements the steps of any one of the above methods when executed by a processor.
[0031] The above-mentioned solid-state drive-based firmware upgrade method, device, computer equipment, and storage medium obtain a firmware upgrade request based on the solid-state drive, wherein the request includes a firmware download command. When the solid-state drive obtains the firmware download command, the configuration parameters of the write buffer are changed so that only one sub-buffer in the write buffer is retained for processing the write command, and the remaining sub-buffers are freed up for storing new firmware. When performing a firmware upgrade, the new firmware is downloaded to the write buffer via the firmware download command. After the firmware upgrade is completed, the configuration parameters of the write buffer are changed to restore the use of all sub-buffers for cyclic processing of write commands. The present invention implements firmware upgrades by reusing the write buffer, significantly reducing the use of DRAM memory, freeing up DRAM memory for use by other key programs, and thereby improving the overall performance of the SSD. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of a firmware upgrade process in conventional technology;
[0033] Figure 2 This is a diagram illustrating the inventive concept of a firmware upgrade method based on a solid-state drive in the present invention;
[0034] Figure 3 1 is a flow chart of a method for upgrading firmware based on a solid-state drive in one embodiment;
[0035] Figure 4 1 is a flow chart of a solid state drive-based firmware upgrade method according to another embodiment;
[0036] Figure 5 is a structural block diagram of a firmware upgrade device based on a solid state drive in one embodiment;
[0037] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0039] During the R&D phase of a solid-state drive, or after it is sold, firmware upgrades are a must-have feature of the SSD. The stability and cost-effectiveness of firmware upgrades are very important. During firmware upgrades, since the firmware files are large, they are downloaded to the SSD in segments. Figure 1As shown in the figure, the current mainstream solution is to permanently allocate a dedicated DRAM memory space to store the segmented downloaded firmware files. This occupies a large amount of DRAM space (ranging from 1MB to 3MB) and is always occupied, which in turn affects the overall performance of the SSD.
[0040] Based on this, the present invention provides a method for upgrading the firmware based on a solid state drive. Figure 2 The invention concept diagram of the firmware upgrade method based on solid state drive is shown. In the present invention, firmware upgrade is achieved by reusing the write buffer, which can significantly reduce the use of DRAM memory and release DRAM memory for use by other key programs.
[0041] In one embodiment, Figure 3 As shown, a firmware upgrade method based on a solid state drive is provided, the method comprising:
[0042] Step 302: Obtain a firmware upgrade request based on the solid state drive, the request including a firmware download command;
[0043] Step 304: Multiple sub-buffers exist in the write buffer of the solid-state drive for cyclically processing write command requests, and each sub-buffer can process one write command at a time;
[0044] Step 306: When the solid-state drive receives a firmware download command, the configuration parameters of the write buffer are changed so that only one sub-buffer in the write buffer is reserved for processing the write command, and the remaining sub-buffers are freed up for storing new firmware.
[0045] Step 308: When performing a firmware upgrade, the new firmware is downloaded to the write buffer via the firmware download command.
[0046] Step 310: After the firmware upgrade is completed, all sub-buffers are restored to process write commands in a cyclic manner by changing the configuration parameters of the write buffer.
[0047] In this embodiment, a firmware upgrade method based on a solid-state drive is provided to address the drawbacks of mainstream solutions. Since the write buffer is essential in SSD firmware, the permanent occupation of DRAM space can be effectively reduced by reusing the write buffer. The specific implementation process of this method is as follows:
[0048] First, the solid-state drive obtains a firmware upgrade request, which includes a firmware download command. When the firmware is upgraded, the new firmware can be downloaded to the SSD firmware via the firmware download command.
[0049] Next, because the write buffer originally has multiple sub-buffers for processing write commands in a loop, with each sub-buffer capable of handling one write command at a time, when a firmware download command is received, the write buffer configuration parameters are changed to free up multiple sub-buffers to store the new firmware, leaving only one sub-buffer to continue processing write commands.
[0050] Finally, after the firmware upgrade is completed, the configuration parameters of the write buffer are changed to restore the use of all sub-buffers to process write commands in a loop. This does not affect the processing of read and write commands, and the write buffer can be reused to upgrade the firmware.
[0051] In this embodiment, a firmware upgrade request from a solid-state drive (SSD) is obtained, including a firmware download command. When the SSD receives the firmware download command, the write buffer configuration parameters are modified so that only one subbuffer in the write buffer is reserved for processing the write command, leaving the remaining subbuffers free for storing the new firmware. During the firmware upgrade, the new firmware is downloaded to the write buffer using the firmware download command. After the firmware upgrade is complete, the write buffer configuration parameters are modified to restore the use of all subbuffers for cyclically processing write commands. This solution significantly reduces DRAM memory usage by reusing the write buffer to implement firmware upgrades, freeing up DRAM memory for use by other critical programs and thereby improving the overall performance of the SSD.
[0052] In one embodiment, Figure 4 As shown, a firmware upgrade method based on a solid state drive is provided, the method comprising:
[0053] Step 402: There are 8 sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests, and each sub-buffer can process one write command at a time;
[0054] Step 404: When the solid-state drive receives the firmware download command, the configuration parameters of the write buffer are changed so that only one sub-buffer in the write buffer is reserved for processing the write command, and the remaining seven sub-buffers are freed for storing the new firmware.
[0055] Step 406: When performing a firmware upgrade, the new firmware is downloaded to the write buffer via the firmware download command.
[0056] Step 408: After the firmware upgrade is completed, the configuration parameters of the write buffer are changed to restore the use of all eight sub-buffers to cyclically process write commands.
[0057] refer to Figure 4 As shown, in this embodiment, a method for completely implementing firmware upgrade based on a solid-state drive is provided. The specific execution steps of the method are as follows:
[0058] Step 1: When upgrading the firmware, the new firmware is downloaded to the SSD firmware using the firmware download command.
[0059] Step 2: The write buffer originally has 8 sub-buffers used to process write commands in a loop, where each sub-buffer can process one write command at a time.
[0060] Step 3: When receiving the firmware download command, the configuration parameters of the write buffer are changed to free up 7 sub-buffers to store the new firmware and only retain one sub-buffer to continue processing the write command.
[0061] Step 4: After the firmware upgrade is complete, change the write buffer configuration parameters to restore the use of 8 sub-buffers to process write commands in a loop.
[0062] In this embodiment, the processing of the read and write commands is not affected, and the write buffer can be reused to upgrade the firmware, which can effectively reduce the permanent occupation of the DRAM space.
[0063] It should be understood that although Figure 1-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1-4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed 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 part of the sub-steps or stages of other steps.
[0064] In one embodiment, Figure 5 As shown, a firmware upgrade device 500 based on a solid state drive is provided, and the device includes:
[0065] An acquisition module 501 is configured to acquire a firmware upgrade request based on a solid-state drive, wherein the request includes a firmware download command.
[0066] A write command module 502 is configured to process write command requests in a loop using multiple sub-buffers in the write buffer of the solid-state drive, where each sub-buffer can process one write command at a time.
[0067] A multiplexing module 503 is configured to, when the solid-state drive receives a firmware download command, change the configuration parameters of the write buffer so that only one sub-buffer in the write buffer is reserved for processing the write command, and to free up the remaining sub-buffers for storing new firmware;
[0068] Download module 504, which is used to download the new firmware to the write buffer through the firmwaredownload command when performing a firmware upgrade;
[0069] The recovery module 505 is used to restore the use of all sub-buffers to cyclically process write commands by changing the configuration parameters of the write buffer after the firmware upgrade is completed.
[0070] In one embodiment, the write command module 502 is further configured to:
[0071] There are 8 sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests. Each sub-buffer can process one write command at a time.
[0072] In one embodiment, the multiplexing module 503 is further configured to:
[0073] When the SSD receives a firmware download command, it changes the write buffer configuration parameters so that only one sub-buffer is reserved for processing the write command, and the remaining seven sub-buffers are freed up for storing the new firmware.
[0074] In one embodiment, the recovery module 505 is further configured to:
[0075] After the firmware upgrade is complete, the write buffer configuration parameters are changed to restore the use of all eight sub-buffers to cyclically process write commands.
[0076] For the specific limitations of the solid state drive-based firmware upgrade device, please refer to the limitations of the solid state drive-based firmware upgrade method above, which will not be repeated here.
[0077] In one embodiment, a computer device is provided, whose internal structure diagram can be as follows: Figure 6 As shown. The computer device includes a processor, a memory, and a network interface connected via a device bus. 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 device, a computer program, and a database. The internal memory provides an environment for the operation of the operating device and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a firmware upgrade method based on a solid-state drive.
[0078] Those skilled in the art will understand that Figure 6 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 shown in the figure, or combine certain components, or have a different component arrangement.
[0079] 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. When the processor executes the computer program, the steps in the above method embodiments are implemented.
[0080] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0081] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. 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 memory, storage, database 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), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0082] The technical features of the above embodiments can 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 specification.
[0083] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for upgrading firmware based on a solid-state drive, characterized in that: The method comprises: Obtaining a firmware upgrade request based on the solid-state drive, wherein the request includes a firmware download command; In the write buffer of the solid-state drive, there are multiple sub-buffers used to cyclically process write command requests. Each sub-buffer can process one write command at a time. When the SSD receives a firmware download command, it changes the write buffer configuration parameters so that only one sub-buffer is reserved for processing the write command, and the remaining sub-buffers are freed up for storing the new firmware. When performing a firmware upgrade, the new firmware is downloaded to the freed sub-buffer in the write buffer via the firmware download command; After the firmware upgrade is completed, the configuration parameters of the write buffer are changed to restore the use of all sub-buffers to cyclically process write commands.
2. The method for upgrading the firmware based on the solid-state drive according to claim 1, wherein: The step of providing a plurality of sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests, wherein each sub-buffer can process one write command at a time, further includes: There are 8 sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests. Each sub-buffer can process one write command at a time.
3. The method for upgrading the firmware based on the solid state drive according to claim 2, wherein: The step of changing the configuration parameters of the write buffer so that only one sub-buffer is reserved in the write buffer for processing the write command and freeing up the remaining sub-buffers for storing the new firmware when the solid-state drive receives the firmware download command further includes: When the SSD receives a firmware download command, it changes the write buffer configuration parameters so that only one sub-buffer is reserved for processing the write command, and the remaining seven sub-buffers are freed up for storing the new firmware.
4. The method for upgrading the firmware based on the solid-state drive according to claim 3, wherein: After the firmware upgrade is completed, the step of resuming the use of all sub-buffers to cyclically process write commands by changing the configuration parameters of the write buffer further includes: After the firmware upgrade is complete, the write buffer configuration parameters are changed to restore the use of all eight sub-buffers to cyclically process write commands.
5. A firmware upgrade device based on a solid state drive, characterized in that: The device comprises: An acquisition module, configured to acquire a firmware upgrade request based on a solid-state drive, wherein the request includes a firmware download command; A write command module, wherein the write command module is used to process write command requests in a loop in a plurality of sub-buffers in the write buffer of the solid-state drive, and each sub-buffer can process one write command at a time; A multiplexing module, wherein when the solid-state drive receives a firmware download command, the multiplexing module is configured to change the configuration parameters of the write buffer so that only one sub-buffer in the write buffer is reserved for processing the write command, and the remaining sub-buffers are freed for storing new firmware; A download module, which is used to download the new firmware to a free sub-buffer in the write buffer through a firmware download command when performing a firmware upgrade; The recovery module is used to restore the use of all sub-buffers to cyclically process write commands by changing the configuration parameters of the write buffer after the firmware upgrade is completed.
6. The firmware upgrade device based on a solid state drive according to claim 5, characterized in that: The write command module is also used for: There are 8 sub-buffers in the write buffer of the solid-state drive for cyclically processing write command requests. Each sub-buffer can process one write command at a time.
7. The solid state drive-based firmware upgrade device according to claim 6, wherein: The multiplexing module is also used for: When the SSD receives a firmware download command, it changes the write buffer configuration parameters so that only one sub-buffer is reserved for processing the write command, and the remaining seven sub-buffers are freed up for storing the new firmware.
8. The solid state drive-based firmware upgrade device according to claim 7, wherein: The recovery module is further configured to: After the firmware upgrade is complete, the write buffer configuration parameters are changed to restore the use of all eight sub-buffers to cyclically process write commands.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
10. 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 4 are implemented.
Citation Information
Patent Citations
Card, device and method for processing extensive application data
CN104267975A
Memory dynamic allocation method and device in firmware upgrading, computer device and storage medium
CN110704084A