Firmware upgrading method and device, readable storage medium and electronic equipment

Through caching and slicing programming technology during the firmware upgrade process, the write I/O busy delay problem caused by the eMMC memory chip firmware upgrade is solved, reducing busy waiting time and improving compatibility, ensuring the reliability of the firmware.

CN118672631AInactive Publication Date: 2024-09-20CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411133767.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-09-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In smart wearable consumer products, the firmware upgrade process of the eMMC memory chip can easily lead to host write I/O busy timeout, leading to crashes and other abnormalities.

Method used

By receiving firmware data, when the amount of data reaches a preset threshold, the data is cached in a temporary storage block, and the actual storage block is programmed based on the data in the temporary storage block. The idea of ​​sharding installation is used to spread the busy waiting time to the data. During downloading.

Benefits of technology

While completing the firmware installation, it reduces the busy delay of host write I/O, improves the compatibility of eMMC, makes it more flexible to use on the client, and ensures the reliability of the firmware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672631A
    Figure CN118672631A
Patent Text Reader

Abstract

The invention discloses a firmware upgrading method and device, a readable storage medium and electronic equipment, when the data size of received partial firmware data reaches a preset threshold value, the partial firmware data is cached to a temporary storage block, and an actual storage block is programmed according to the partial firmware data in the temporary storage block, so that the firmware upgrading efficiency is improved. Therefore, when the firmware data is received, programming of the actual storage block is carried out, and advanced programming of the Target block is realized, so that when firmware installation is completed, the bus latch of host writing I / O is reduced, the compatibility of the eMMC to various hosts is improved, and the eMMC is more flexible to use at a client.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of firmware upgrade technology, and in particular to a firmware upgrade method, device, readable storage medium and electronic device. Background Art

[0002] In some smart wearable consumer products, hardware interrupts are used as standard limits for determining the write I / O busy (input / output busy) timeout of storage devices. However, for general eMMC (embedded, non-volatile storage system) storage chips, the write commands included in the firmware upgrade require longer data processing time, which can easily lead to host command timeouts. Conventional eMMC firmware upgrade solutions execute firmware download and firmware installation in sequence, resulting in timeouts in the eMMC write I / O of the firmware upgrade, host crashes, and other anomalies. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a firmware upgrade method, device, readable storage medium and electronic device, which can reduce the busy delay of host write I / O while completing firmware installation.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: A firmware upgrade method comprises the steps of: Receive some firmware data; If the data volume of the partial firmware data reaches a preset threshold, the partial firmware data is cached in a temporary storage block, and the actual storage block is programmed according to the partial firmware data in the temporary storage block.

[0005] In order to solve the above technical problems, another technical solution adopted by the present invention is: A firmware upgrade device, comprising: A data receiving module, used for receiving part of the firmware data; The data programming module is used to cache the partial firmware data to a temporary storage block if the data volume of the partial firmware data reaches a preset threshold, and program the actual storage block according to the partial firmware data in the temporary storage block.

[0006] The beneficial effect of the present invention is that when the data volume of the received partial firmware data reaches a preset threshold, the partial firmware data is cached to a temporary storage block (Tmp block), and the actual storage block is programmed according to the partial firmware data in the temporary storage block, so that the actual storage block (Target block) is programmed while receiving the firmware data, and the Target block is programmed in advance, thereby completing the firmware installation while reducing the busy latency of the host write I / O, improving the compatibility of the eMMC with various hosts, and making the eMMC more flexible to use on the client. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 A flowchart of a firmware upgrade method according to an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a firmware upgrade device according to an embodiment of the present invention; Figure 3 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention; Figure 4 is an upgrade flow chart of the firmware upgrade method in an embodiment of the present invention; Figure 5 A schematic diagram of programming in a firmware upgrade method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0008] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0009] Please refer to Figure 1 , a firmware upgrade method, comprising the steps of: Receive some firmware data; If the data volume of the partial firmware data reaches a preset threshold, the partial firmware data is cached in a temporary storage block, and the actual storage block is programmed according to the partial firmware data in the temporary storage block.

[0010] From the above description, it can be seen that the beneficial effect of the present invention is that: when the data amount of the received partial firmware data reaches a preset threshold, the partial firmware data is cached to a temporary storage block (Tmp block), and the actual storage block is programmed according to the partial firmware data in the temporary storage block, so that the actual storage block (Targetblock) is programmed while receiving the firmware data, and the Target block is programmed in advance, thereby completing the firmware installation while reducing the busy latency of the host write I / O, improving the compatibility of the eMMC with various hosts, and making the eMMC more flexible to use on the client.

[0011] Further, programming the actual storage block according to the part of the firmware data in the temporary storage block includes: Determine the number of executions; After the actual storage block is sliced ​​according to the number of executions, a slice upgrade is performed on each slice of the actual storage block after the slice according to the partial firmware data in the temporary storage block; Determine whether all firmware data has been received. If so, perform the last slice upgrade on the actual storage block according to the firmware data in the temporary storage block. If not, return to execute the step of caching the part of the firmware data to the temporary storage block.

[0012] From the above description, it can be seen that in the process of pre-programming the Target block, the idea of ​​sharding installation is used to disperse the busy time consumption originally accumulated at the end of firmware data download to data download, thereby greatly reducing the busy latency of the host write I / O.

[0013] Further, determining the number of executions includes: Obtaining the total number of pages of the actual storage block and the minimum number of pages required to store a copy of firmware data; Determine the total number of fragmentation times according to the total number of pages of the actual storage block and the minimum number of pages required to store one copy of firmware data; The number of executions is determined according to the total number of fragmentations.

[0014] From the above description, it can be seen that since the host's firmware download command has a certain time requirement for the release of the busy signal, the number of executions is based on the total number of pages of the actual storage block and the minimum number of pages required to store a piece of firmware data, that is, the minimum granularity of the shard is the page of the Nand block, so as to shorten the host's perception of this period of time by using the shard execution method.

[0015] Further, determining the total number of fragmentation times according to the total number of pages of the actual storage block and the minimum number of pages required to store one copy of firmware data includes: Total number of fragmentation times = total number of pages actually storing blocks / minimum number of pages required to store a copy of firmware data.

[0016] From the above description, it can be seen that the total number of sharding times is determined according to the total number of pages of the actual storage block and the minimum number of pages required to store a piece of firmware data, thereby effectively reducing the busy latency of each write I / O on the host side.

[0017] Further, determining the number of executions according to the total number of shards includes: Subtract one from the total number of fragments to obtain the number of executions.

[0018] From the above description, we can know that the total number of fragments is reduced by one to get the number of executions, and the number of page programming can be flexibly adjusted.

[0019] Further, performing the last shard upgrade on the actual storage block according to the firmware data in the temporary storage block includes: The last slice upgrade is performed on the actual storage block according to the firmware data in the temporary storage block according to the minimum number of pages required to store one copy of the firmware data.

[0020] From the above description, it can be seen that limiting the last shard upgrade to be performed after the data is received is completed, thereby ensuring the reliability of the firmware.

[0021] Furthermore, before receiving part of the firmware data, the method further includes: The amount of valid data in the firmware data is determined, and the amount of valid data is used as a preset threshold.

[0022] It can be seen from the above description that the firmware data includes valid data and invalid data. The number of valid data in the firmware data is used as a preset threshold to ensure the subsequent firmware installation effect.

[0023] Please refer to Figure 2 Another embodiment of the present invention provides a firmware upgrade device, comprising: A data receiving module, used for receiving part of the firmware data; The data programming module is used to cache the partial firmware data to a temporary storage block if the data volume of the partial firmware data reaches a preset threshold, and program the actual storage block according to the partial firmware data in the temporary storage block.

[0024] Another embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step in the above-mentioned firmware upgrade method is implemented.

[0025] Please refer to Figure 3 Another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned firmware upgrade method when executing the computer program.

[0026] The firmware upgrade method, device, readable storage medium and electronic device of the present invention can be applied to eMMC storage chips, and are described below through specific implementation methods: Please refer to Figure 1 , Figure 4 and Figure 5 , Embodiment 1 of the present invention is: A firmware upgrade method comprises the steps of: S0. Determine the amount of valid data in the firmware data, and use the amount of valid data as a preset threshold.

[0027] S1, receiving some firmware data, such as Figure 4 shown.

[0028] Specifically, some firmware data sent by the host is received. In an optional implementation, the sending method supports piecewise downloading, multi-I / O downloading, or one-write command downloading, etc., and complies with the eMMC protocol standard.

[0029] S2. If the amount of the partial firmware data reaches a preset threshold, the partial firmware data is cached to a temporary storage block, and the actual storage block is programmed according to the partial firmware data in the temporary storage block, specifically including S21-S24: S21, caching the part of firmware data to a temporary storage block, so as to avoid data loss caused by power failure.

[0030] S22, determine the number of executions, specifically including S221-S223: S221. Obtain the total number of pages of the actual storage block and the minimum number of pages required to store one copy of firmware data.

[0031] S222: Determine the total number of fragmentation times according to the total number of pages of the actual storage block and the minimum number of pages required to store one copy of firmware data, specifically: Total number of fragmentation times = total number of pages actually storing blocks / minimum number of pages required to store a copy of firmware data.

[0032] S223. Determine the number of executions according to the total number of fragmentations.

[0033] Specifically, the total number of fragmentations is reduced by one to obtain the number of executions.

[0034] S23, after the actual storage block is sliced ​​according to the number of executions, a slice upgrade is performed on each slice of the actual storage block after the slice according to the partial firmware data in the temporary storage block, such as Figure 4 shown.

[0035] Specifically, after the actual storage block is sliced ​​according to the number of executions with the minimum number of pages required to store a piece of firmware data as the minimum granularity, a slice upgrade is performed on each slice of the actual storage block after the slice according to the partial firmware data in the temporary storage block.

[0036] S24, determining whether all firmware data has been received; if so, performing the last shard upgrade on the actual storage block according to the firmware data in the temporary storage block; if not, returning to execute S21.

[0037] The performing the last shard upgrade on the actual storage block according to the firmware data in the temporary storage block comprises: The last slice upgrade is performed on the actual storage block according to the firmware data in the temporary storage block according to the minimum number of pages required to store a copy of the firmware data, thereby ensuring the reliability of the firmware upgrade.

[0038] like Figure 5 As shown, the Target block is programmed while receiving the firmware data, realizing advance programming, thereby reducing the busy latency of the host write I / O while completing the firmware installation, improving the compatibility of eMMC with various hosts, and making the eMMC more flexible to use on the client side.

[0039] Please refer to Figure 2 , Embodiment 2 of the present invention is: A firmware upgrade device, comprising: A data receiving module, used for receiving part of the firmware data; The data programming module is used to cache the partial firmware data to a temporary storage block if the data volume of the partial firmware data reaches a preset threshold, and program the actual storage block according to the partial firmware data in the temporary storage block.

[0040] Embodiment 3 A computer-readable storage medium stores a computer program, which can implement each step of the firmware upgrade method in embodiment 1 when executed by a processor.

[0041] Embodiment 4 Please refer to Figure 3 , an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the firmware upgrade method in the first embodiment when executing the computer program.

[0042] In summary, the firmware upgrade method, device, readable storage medium and electronic device provided by the present invention, when the data amount of the received part of the firmware data reaches a preset threshold, the part of the firmware data is cached to the temporary storage block, and the actual storage block is programmed according to the part of the firmware data in the temporary storage block, so that the actual storage block is programmed while receiving the firmware data, and the Target block is programmed in advance, so as to reduce the busy delay of the host write I / O while completing the firmware installation, improve the compatibility of eMMC with various hosts, and make the eMMC more flexible to use on the client; at the same time, in the process of programming the Target block in advance, the idea of ​​​​slice installation is used to disperse the busy time consumption originally accumulated at the end of the firmware data download to the data download; in addition, the last slice upgrade is limited to be performed after the data is received, thereby ensuring the reliability of the firmware.

[0043] In the above embodiments provided in the present application, it should be understood that the disclosed methods, devices, computer-readable storage media, and electronic devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple components or modules can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or components or modules, which can be electrical, mechanical or other forms.

[0044] The components described as separate components may or may not be physically separated, and the components shown as components may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0045] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0046] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0047] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0048] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0049] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A firmware upgrade method, characterized in that: Including steps: Receive some firmware data; If the data volume of the partial firmware data reaches a preset threshold, the partial firmware data is cached in a temporary storage block, and the actual storage block is programmed according to the partial firmware data in the temporary storage block.

2. A firmware upgrade method according to claim 1, characterized in that: The programming of the actual storage block according to the portion of firmware data in the temporary storage block comprises: Determine the number of executions; After slicing the actual storage block according to the number of executions, performing a slicing upgrade on each slicing of the actual storage block according to the partial firmware data in the temporary storage block; Determine whether all firmware data has been received. If so, perform the last fragment upgrade on the actual storage block according to the firmware data in the temporary storage block. If not, return to the step of caching the part of the firmware data to the temporary storage block.

3. A firmware upgrade method according to claim 2, characterized in that: Determining the number of executions includes: Obtaining the total number of pages of the actual storage block and the minimum number of pages required to store one copy of firmware data; Determine the total number of fragmentations according to the total number of pages of the actual storage block and the minimum number of pages required to store one copy of firmware data; The number of executions is determined according to the total number of fragments.

4. A firmware upgrade method according to claim 3, characterized in that: Determining the total number of fragmentation times according to the total number of pages of the actual storage block and the minimum number of pages required to store one copy of firmware data includes: Total number of fragments = total number of pages actually storing blocks / minimum number of pages required to store one copy of firmware data.

5. A firmware upgrade method according to claim 3, characterized in that: Determining the number of executions according to the total number of fragments includes: Subtract one from the total number of fragments to obtain the number of executions.

6. A firmware upgrade method according to claim 2, characterized in that: The performing the last shard upgrade on the actual storage block according to the firmware data in the temporary storage block comprises: A final slice upgrade is performed on the actual storage block according to the firmware data in the temporary storage block according to the minimum number of pages required to store one copy of the firmware data.

7. A firmware upgrade method according to claim 1, characterized in that: Before receiving part of the firmware data, the method further includes: The amount of valid data in the firmware data is determined, and the amount of valid data is used as a preset threshold.

8. A firmware upgrade device, characterized in that: include: A data receiving module, used for receiving part of the firmware data; The data programming module is used to cache the partial firmware data to a temporary storage block if the data volume of the partial firmware data reaches a preset threshold, and program the actual storage block according to the partial firmware data in the temporary storage block.

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

10. An electronic 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, each step in the firmware upgrade method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Firmware remote upgrading method and device, terminal, mobile equipment and storage medium

    CN110704077A

  • Firmware upgrading method and device, equipment and storage medium

    CN115794170A

  • EMMC upgrading method, chip, equipment and storage medium

    CN117348909A