CN116483280B - Firmware storage method, firmware searching method, device and medium - Google Patents
Firmware storage method, firmware searching method, device and medium Download PDFInfo
- Publication number
- CN116483280B CN116483280B CN202310465337.9A CN202310465337A CN116483280B CN 116483280 B CN116483280 B CN 116483280B CN 202310465337 A CN202310465337 A CN 202310465337A CN 116483280 B CN116483280 B CN 116483280B
- Authority
- CN
- China
- Prior art keywords
- firmware
- flash memory
- memory block
- target
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004891 communication Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000006467 substitution reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- GDTBXPJZTBHREO-UHFFFAOYSA-N bromine Chemical compound BrBr GDTBXPJZTBHREO-UHFFFAOYSA-N 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000010410 layer Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 239000002356 single layer Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0631—Configuration or reconfiguration of storage systems by allocating resources to storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The embodiment of the application provides a firmware storage method, a firmware searching method, equipment and a medium, wherein the firmware storage method comprises the following steps: determining a target data page from a plurality of data pages of each flash memory block, and enabling page numbers of the target data pages of each flash memory block to be different; storing target firmware to be stored from an initial position of a target data page of each flash memory block to store the target firmware in each flash memory block; if the data stored in the data pages of the same page number of the plurality of flash memory blocks are lost due to the instability of the flash memory blocks, the data of the firmware stored in all the flash memory blocks are not lost, and the data pages of part of the flash memory blocks can be ensured to still store the data of the firmware.
Description
Technical Field
Embodiments of the present application relate to, but are not limited to, the field of memory, and in particular, to a firmware storage method, a firmware searching method, a device, and a medium.
Background
The present flash memory chip is provided with a plurality of flash memory blocks, and the flash memory blocks are provided with a plurality of data pages. The firmware is stored in the form of a binary file in successive data pages of the flash blocks and in data pages of the same page number of the plurality of flash blocks. However, the characteristics of the flash memory are limited, if the flash memory blocks are unstable, the data stored in the data pages of the same page number of the plurality of flash memory blocks are lost, and although the firmware is stored in the plurality of flash memory blocks, the firmware stored in the data pages of the same page number of the plurality of flash memory blocks is lost, so that the firmware is lost and cannot be retrieved.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The application aims to solve one of the technical problems existing in the related art to at least a certain extent, and the embodiment of the application provides a firmware storage method, a firmware searching method, a device and a medium, which can reduce the risk of losing firmware by storing target firmware to be stored in data pages of different pages of a plurality of flash memory blocks.
An embodiment of a first aspect of the present application is a firmware storage method applied to a flash memory chip, where the flash memory chip is provided with a plurality of flash memory blocks, and each flash memory block has a plurality of data pages; the firmware storage method comprises the following steps:
determining a target data page from a plurality of data pages of each flash memory block, and enabling page numbers of the target data pages of each flash memory block to be different;
storing target firmware to be stored from an initial position of the target data page of each flash memory block to store the target firmware in each flash memory block.
In certain embodiments of the first aspect of the present application, the determining a target data page from the plurality of data pages of each flash block, and making the page numbers of the target data pages of each flash block different, includes:
acquiring the global data page number of a legal data page according to the identification code of the target firmware and a preset firmware guide table;
and determining a target data page from a plurality of data pages of each flash memory block according to the global data page number, and enabling the page numbers of the target data pages of each flash memory block to be different.
In some embodiments of the first aspect of the present application, the global data page number is a product of a range coefficient and a custom constant, the range coefficient corresponding to each data page of the same flash memory block is different, the range coefficient interval corresponding to each flash memory block is different, and the custom constant corresponding to each flash memory block is different.
In certain embodiments of the first aspect of the present application, the custom constants are expressed as: bk+ck; wherein A is a fixed constant value; bk is a b value corresponding to a kth flash memory block, and bk is prime number in a preset threshold; ck is a c value corresponding to a kth flash memory block, and ck is a prime number in a preset threshold.
In certain embodiments of the first aspect of the present application, the storing the target firmware to be stored from an initial position of a target data page of the flash memory block to store the target firmware in each of the flash memory blocks includes:
and storing target firmware to be stored from the initial position of a target data page of the flash memory block, and sequentially storing the target firmware in continuous pages of the flash memory block so as to store the target firmware in each flash memory block.
An embodiment of a second aspect of the present application is a firmware search method applied to a flash memory chip, where the flash memory chip is provided with a plurality of flash memory blocks, and each flash memory block has a plurality of data pages; the firmware is stored in the flash memory chip according to the firmware storage method; the firmware searching method comprises the following steps:
obtaining a global data page number according to an identification code of a target firmware to be searched and a preset firmware guide table;
determining a target data page from a plurality of data pages of the flash memory block according to the global data page number;
and reading from the initial position of the target data page to find and obtain target firmware.
In some embodiments of the second aspect of the present application, the global data page number is a product of a range coefficient and a custom constant, the range coefficient corresponding to each data page of the same flash memory block is different, the range coefficient interval corresponding to each flash memory block is different, and the custom constant corresponding to each flash memory block is different.
In certain embodiments of the second aspect of the present application, the custom constant is expressed as: bk+ck; wherein A is a fixed constant value; bk is a b value corresponding to a kth flash memory block, and bk is prime number in a preset threshold; ck is a c value corresponding to a kth flash memory block, and ck is a prime number in a preset threshold.
An embodiment of the third aspect of the present application, an electronic device, includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the firmware storage method or the firmware search method as described above when executing the computer program.
An embodiment of the fourth aspect of the present application is a computer-readable storage medium storing computer-executable instructions for performing the firmware storage method or the firmware search method as described above.
The scheme has at least the following beneficial effects: by storing the target firmware to be stored in the data pages of different pages of the plurality of flash memory blocks, if the data pages of the same page of the plurality of flash memory blocks are lost due to unstable flash memory blocks, the data of the firmware stored in all the flash memory blocks is not lost, and the data pages of part of the flash memory blocks can be ensured to still store the data of the firmware, thereby solving the problems that the same firmware is lost and cannot be retrieved due to the fact that the same firmware is stored from the data pages of the same page of each flash memory block.
Drawings
The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate and do not limit the application.
FIG. 1 is a schematic diagram of storing firmware using a prior art firmware storage method;
FIG. 2 is a step diagram of a firmware storage method provided by an embodiment of the present application;
FIG. 3 is a step diagram of a firmware lookup method provided by an embodiment of the present application;
fig. 4 is a schematic diagram of storing firmware using a firmware storing method provided by an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description, in the claims and in the above-described figures, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
Embodiments of the present application will be further described below with reference to the accompanying drawings.
The embodiment of the application provides a firmware storage method which is applied to a flash memory chip, wherein the flash memory chip is provided with a plurality of flash memory blocks, and each flash memory block is provided with a plurality of data pages. Flash block is bolck and data page is page.
The flash memory chip is an embedded multimedia memory card (Embedded Multi Media Card, eMMC) or a universal flash memory (Universal Flash Storage, UFS).
The embedded multimedia memory card comprises a control interface (Control Interface), a memory chip (Flash Memory Chip), a Boot area (Boot Partition) and an embedded multimedia main Controller (eMMC Controller). The embedded multimedia main controller controls the read-write operation of the whole embedded multimedia memory card, including the functions of command decoding, data transmission, error detection and the like. The memory chip is responsible for actual data storage and reading, and single-layer or multi-layer flash memory can be used. The control interface is connected with the main board and the eMMC chip and used for data transmission, power management and other operations. The Boot area is used for storing a device Boot program and ensuring normal starting of the device. The embedded multimedia memory card has the characteristics of low power consumption, small size, high reliability, easy integration and the like, and can provide rapid and stable data transmission and storage functions. The embedded multimedia memory card can support high-speed data read-write operation, such as playing and recording of multimedia data of video, audio, images and the like.
The general flash memory mainly comprises a memory chip, a controller chip and a high-speed serial interface. The memory chip is used for storing data and codes; the controller chip is used for processing instructions from the host device and operating the flash memory; the high-speed serial interface is used for connecting the host device and the controller chip to realize quick data transmission. The memory card format of the flash memory is developed, and the confusion of consumers on various memory card formats on the market and the use of different memory card adapters can be reduced while providing high data transmission speed and stability. The biggest difference of UFS compared with eMMC is that the parallel signal is changed to a more advanced serial signal, so that the frequency can be rapidly increased; simultaneously, half duplex is changed into full duplex; UFS is based on a small computer system interface architecture model (SCSI architectural model) and supports SCSI tag instruction sequences (SCSI Tagged Command Queuing).
The present flash memory chip is provided with a plurality of flash memory blocks, and the flash memory blocks are provided with a plurality of data pages. The firmware is stored in the form of a binary file in successive data pages of the flash block. Specifically, the firmware of the flash memory is typically stored in units of data pages in the flash memory blocks. Each data page is typically made up of a plurality of bytes or sectors, which are arranged in a particular format. Firmware is typically split into multiple data pages and stored in sequence in successive data pages of a flash block. When writing firmware, the flash controller writes firmware data page by page into the flash blocks. If the firmware needs to be updated, the new firmware data can be written to the corresponding data page in a similar manner.
Referring to fig. 1, firmware may be stored in a plurality of flash blocks, but for the same firmware, each flash block is stored starting from a data page of the same page number. For example, one flash memory chip includes a flash block0, a flash block1, a flash block2; for one firmware a, the flash block0 stores the firmware a from the data page0 of the flash block0, and similarly, the flash block1 stores the firmware a from the data page0 of the flash block1, and the flash block2 stores the firmware a from the data page0 of the flash block 2.
However, the characteristics of the flash memory are limited, if the flash memory blocks are unstable, the data stored in the data pages of the same page number of the plurality of flash memory blocks are lost, and although the firmware is stored in the plurality of flash memory blocks, the firmware stored in the data pages of the same page number of the plurality of flash memory blocks is lost, so that the firmware is lost and cannot be retrieved.
For example, if the data of the flash memory block is unstable and the data of the data page0 of the flash memory block0, the data page0 of the flash memory block1, and the data page0 of the flash memory block2 are lost, the firmware a stored in the flash memory chip is lost and cannot be retrieved.
According to the embodiment of the application, the situation that the same firmware is lost and cannot be retrieved due to the fact that the same firmware is stored from the data pages with the same page number of each flash memory block is solved by the following firmware storage method.
Referring to fig. 2, the firmware storage method includes, but is not limited to, the steps of:
step S100, determining a target data page from a plurality of data pages of each flash memory block, and enabling page numbers of the target data pages of each flash memory block to be different;
in step S200, the target firmware to be stored is stored from the initial position of the target data page of each flash block to store the target firmware in each flash block.
In this embodiment, the target firmware to be stored is stored in the data pages of different pages of the plurality of flash memory blocks, so if the data stored in the data pages of the same page of the plurality of flash memory blocks is lost due to unstable flash memory blocks, the data of the firmware stored in all the flash memory blocks is not lost, and the data pages of part of the flash memory blocks can be ensured to still store the data of the firmware, thereby solving the problems that the same firmware is lost and cannot be retrieved due to the fact that the same firmware is stored from the data pages of the same page of each flash memory block.
For step S100, determining a target data page from a plurality of data pages of each flash block, and making the page numbers of the target data pages of each flash block different, includes, but is not limited to, the steps of:
step S110, acquiring the global data page number of a legal data page according to the identification code of the target firmware and a preset firmware guide table;
step S120, determining a target data page from a plurality of data pages of each flash memory block according to the global data page number, and enabling the page numbers of the target data pages of each flash memory block to be different.
It will be appreciated that the global data page number is a row address, i.e. Ppage. Each data page has a unique global data page number that identifies the data page, specifies the location of the data page, and maps to a physical address. The global data page number is typically generated by the controller of the chip.
The firmware boot table is as follows:
0...a0 | A*b0+c0 |
1...a1 | A*b1+c1 |
1...a2 | A*b2+c2 |
1...a3 | A*b3+c3 |
1...a4 | A*b4+c4 |
1...a5 | A*b5+c5 |
... | ... |
the global data page number is the product of the range coefficient and the custom constant, the range coefficient corresponding to each data page of the same flash memory block is different, the range coefficient interval corresponding to each flash memory block is different, and the custom constant corresponding to each flash memory block is different.
The custom constants are expressed as: bk+ck; wherein a is a fixed constant value, e.g. 2; bk is a b value corresponding to a kth flash memory block, and bk is prime number in a preset threshold; ck is a c value corresponding to a kth flash memory block, and ck is a prime number in a preset threshold.
Specifically, if the preset threshold is 100, bk is a prime number in 100, and ck is a prime number in 100; of course, although the embodiment of the present application gives the preset threshold value of 100, this does not limit the value of determining the preset threshold value in the embodiment of the present application. In other embodiments, the value of the preset threshold may be other values, such as 500.
The boot table is available from firmware:
the plurality of ppages corresponding to the first firmware are respectively: ppage 0=0 (a b0+c0); ppage 1=1 (a b0+c0); ppage 2=2 (a×b0+c0); ..; ppagen=a0 (a×b0+c0).
The plurality of ppages corresponding to the second firmware are respectively: ppage 0=1 (a×b1+c1); ppage 1=2 (a×b1+c1); ppage 2=3 (a×b1+c1); ..; ppagen=a1 (a×b1+c1).
And so on, the third firmware, the fourth firmware and the Ppage corresponding to the kth firmware can be obtained.
The storage position of the firmware, namely the block and the page corresponding to the firmware, can be determined according to the Ppage.
By the configuration mode, the same firmware can be stored in different data pages of different flash memory blocks.
It will be appreciated that while the above manner of determining the target data page is presented in embodiments of the present application, this is not intended to limit the manner in which the target data page is determined in embodiments of the present application. In other embodiments, the target data page may be determined in other ways, such that the page numbers of the target data page are different for each flash block, e.g., a key index table, etc.
For step S200, the target firmware to be stored is stored starting from the initial position of the target data page of each flash block to store the target firmware in each flash block.
Specifically, the firmware of the flash memory chip is typically stored in units of data pages in the flash memory blocks. Each data page is typically made up of a plurality of bytes or sectors, which are arranged in a particular format. Firmware is typically split into multiple data pages and stored in sequence in successive data pages of a flash block. When writing the firmware, the firmware programming program searches legal blocks and pages from top to bottom according to the firmware guide table to perform programming, and writes the firmware data into the flash memory block page by page. The flash memory chip stores the target firmware to be stored from the initial position of the target data page of the flash memory block and sequentially stores in successive pages of the flash memory block to store the target firmware in each flash memory block.
Referring to fig. 4, for example, for the first flash block0, if the data page1 is determined as the target page number of the first flash block0, the firmware a to be stored is stored from the initial position of the data page1 of the flash block0 and sequentially stored in consecutive pages of the flash block. If the firmware a needs two data pages to write, the data page1 and the data page2 of the first flash block0 store the firmware a.
For the second flash block1, determining the data page5 as the target page number of the second flash block1, and storing the firmware A to be stored from the initial position of the data page5 of the second flash block1 and sequentially storing the firmware A in the continuous pages of the flash block. If the firmware a needs two data pages to write, the data page5 and the data page6 of the second flash block1 store the firmware a.
For the third flash block2, determining the data page4 as the target page number of the third flash block2, and storing the firmware A to be stored from the initial position of the data page4 of the second flash block1 and sequentially in the continuous pages of the flash blocks. If the firmware a needs two data pages to write, the data page4 and the data page5 of the third flash block2 store the firmware a.
When the data of the data page1 of the flash block0, the data page1 of the flash block1 and the data page1 of the flash block2 of the flash chip are lost, the data page5 and the data page6 of the second flash block1 or the data page4 and the data page5 of the third flash block2 can be read to extract the firmware a. And further, the data pages of part of the flash memory blocks are still ensured to store the data of the firmware, so that the problem that the firmware is lost and cannot be retrieved due to the fact that the same firmware is stored from the data pages of the same page number of each flash memory block is solved.
Correspondingly, the embodiment of the application provides a firmware searching method. The firmware searching method is applied to a flash memory chip, wherein the flash memory chip is provided with a plurality of flash memory blocks, and each flash memory block is provided with a plurality of data pages; firmware is stored in the flash memory chip according to the firmware storage method as above.
When the firmware is booted, the BROM of the flash memory chip is responsible for reading operation, and the firmware is read from the flash memory block and the data page.
Referring to fig. 3, the firmware lookup method includes, but is not limited to, the steps of:
step S300, obtaining a global data page number according to an identification code of a target firmware to be searched and a preset firmware guide table;
step S400, determining a target data page from a plurality of data pages of the flash memory block according to the global data page number;
step S500, reading from the initial position of the target data page to find the target firmware.
For step S300, the firmware boot table is as follows:
0...a0 | A*b0+c0 |
1...a1 | A*b1+c1 |
1...a2 | A*b2+c2 |
1...a3 | A*b3+c3 |
1...a4 | A*b4+c4 |
1...a5 | A*b5+c5 |
... | ... |
the global data page number is the product of the range coefficient and the custom constant, the range coefficient corresponding to each data page of the same flash memory block is different, the range coefficient interval corresponding to each flash memory block is different, and the custom constant corresponding to each flash memory block is different.
The custom constants are expressed as: bk+ck; wherein a is a fixed constant value, e.g. 2; bk is a b value corresponding to a kth flash memory block, and bk is prime number in a preset threshold; ck is a c value corresponding to a kth flash memory block, and ck is a prime number in a preset threshold.
Specifically, if the preset threshold is 100, bk is a prime number in 100, and ck is a prime number in 100; of course, although the embodiment of the present application gives the preset threshold value of 100, this does not limit the value of determining the preset threshold value in the embodiment of the present application. In other embodiments, the value of the preset threshold may be other values, such as 500.
The boot table is available from firmware:
the plurality of ppages corresponding to the first firmware are respectively: ppage 0=0 (a b0+c0); ppage 1=1 (a b0+c0); ppage 2=2 (a×b0+c0); ..; ppagen=a0 (a×b0+c0).
The plurality of ppages corresponding to the second firmware are respectively: ppage 0=1 (a×b1+c1); ppage 1=2 (a×b1+c1); ppage 2=3 (a×b1+c1); ..; ppagen=a1 (a×b1+c1).
And so on, the third firmware, the fourth firmware and the Ppage corresponding to the kth firmware can be obtained.
The storage position of the firmware, namely the block and the page corresponding to the firmware, can be determined according to the Ppage.
Obtaining a global data page number according to the identification code of the target firmware to be searched and the firmware guide table; for example, multiple global data page numbers for firmware a may be known from the firmware boot table.
For step S400, since each data page has a unique global data page number, determining a target data page from the plurality of data pages of the flash memory block according to the global data page number; for example, the target data page of the firmware a is known to be the data page1 of the flash block0, the data page5 of the flash block1, and the data page4 of the flash block2 corresponding to the identification code a from the plurality of global data page numbers of the firmware a.
For step S500, the target firmware is found by starting reading from the initial position of the target data page of the target flash block.
For example, reading starts from the initial position of the data page1 of the flash block0, and data is read page by page until the end identifier of the firmware is read. If the end identification of the firmware A is read in the data page2, namely, the data page1 and the data page2 of the flash block0 are read, and the firmware A is obtained.
Or, reading from the initial position of the data page5 of the flash block1, and reading data page by page until the end mark of the firmware is read. If the end identification of the firmware A is read in the data page6, namely, the data page5 and the data page6 of the flash block1 are read, and the firmware A is obtained.
Or, reading from the initial position of the data page4 of the flash block2, and reading data page by page until the end mark of the firmware is read. If the end identification of the firmware A is read in the data page5, namely, the data page4 and the data page5 of the flash block2 are read, and the firmware A is obtained.
The embodiment of the application provides electronic equipment. An electronic device includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the firmware storage method as described above or the firmware search method as described above when executing the computer program.
The electronic equipment can be any intelligent terminal including a computer and the like.
Generally, for the hardware structure of the electronic device, the processor may be implemented by using a general-purpose CPU (central processing unit), a microprocessor, an application-specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC), or one or more integrated circuits, etc. to execute related programs, so as to implement the technical solution provided by the embodiments of the present application.
The memory may be implemented in the form of read-only memory (ReadOnlyMemory, ROM), static storage, dynamic storage, or random access memory (RandomAccessMemory, RAM). The memory may store an operating system and other application programs, and when the technical solutions provided in the embodiments of the present disclosure are implemented by software or firmware, relevant program codes are stored in the memory, and the processor invokes the method for executing the embodiments of the present disclosure.
The input/output interface is used for realizing information input and output.
The communication interface is used for realizing communication interaction between the device and other devices, and can realize communication in a wired mode (such as USB, network cable and the like) or in a wireless mode (such as mobile network, WIFI, bluetooth and the like).
The bus transfers information between the various components of the device, such as the processor, memory, input/output interfaces, and communication interfaces. The processor, memory, input/output interface and communication interface are communicatively coupled to each other within the device via a bus.
Embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions for performing the firmware storage method as described above or the firmware search method as described above.
It should be appreciated that the method steps in embodiments of the present application may be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in non-transitory computer-readable memory. The method may use standard programming techniques. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes (or variations and/or combinations thereof) described herein may be performed under control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications), by hardware, or combinations thereof, collectively executing on one or more processors. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable, including, but not limited to, a personal computer, a smart phone, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and so forth. Aspects of the application may be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and/or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, which when read by a computer, is operable to configure and operate the computer to perform the processes described herein. Further, the machine readable code, or portions thereof, may be transmitted over a wired or wireless network. When such media includes instructions or programs that, in conjunction with a microprocessor or other data processor, implement the above steps, the application herein includes these and other different types of non-transitory computer-readable storage media. The application also includes the computer itself when programmed according to the methods and techniques of the application.
A computer program can be applied to the input data to perform the functions herein to convert the input data to generate output data that is stored to the non-volatile memory. The output information may also be applied to one or more output devices such as a display. In a preferred embodiment of the application, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on a display.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the application, the scope of which is defined by the claims and their equivalents.
While the preferred embodiment of the present application has been described in detail, the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present application, and the equivalent modifications or substitutions are intended to be included in the scope of the present application as defined in the appended claims.
Claims (6)
1. A firmware storage method is characterized by being applied to a flash memory chip, wherein the flash memory chip is provided with a plurality of flash memory blocks, and each flash memory block is provided with a plurality of data pages; the firmware storage method comprises the following steps:
determining a target data page from a plurality of data pages of each flash memory block, and enabling page numbers of the target data pages of each flash memory block to be different;
storing target firmware to be stored from an initial position of the target data page of each flash memory block to store the target firmware in each flash memory block;
the determining a target data page from a plurality of data pages of each flash memory block, and making the page numbers of the target data pages of each flash memory block different includes:
acquiring the global data page number of a legal data page according to the identification code of the target firmware and a preset firmware guide table;
determining a target data page from a plurality of data pages of each flash memory block according to the global data page number, and enabling page numbers of the target data pages of each flash memory block to be different;
the global data page number is the product of the range coefficient and the custom constant, the range coefficient corresponding to each data page of the same flash memory block is different, the range coefficient interval corresponding to each flash memory block is different, and the custom constant corresponding to each flash memory block is different.
2. The firmware storage method of claim 1, wherein the custom constant is expressed as: bk+ck; wherein A is a fixed constant value; bk is a b value corresponding to a kth flash memory block, and bk is prime number in a preset threshold; ck is a c value corresponding to a kth flash memory block, and ck is a prime number in a preset threshold.
3. The method according to claim 1, wherein storing the target firmware to be stored from an initial position of a target data page of the flash memory block to store the target firmware in each of the flash memory blocks, comprises:
and storing target firmware to be stored from the initial position of a target data page of the flash memory block, and sequentially storing the target firmware in continuous pages of the flash memory block so as to store the target firmware in each flash memory block.
4. The firmware searching method is characterized by being applied to a flash memory chip, wherein the flash memory chip is provided with a plurality of flash memory blocks, and each flash memory block is provided with a plurality of data pages; the firmware is stored in the flash memory chip according to the firmware storage method as claimed in any one of claims 1 to 3; the firmware searching method comprises the following steps:
obtaining a global data page number according to an identification code of a target firmware to be searched and a preset firmware guide table;
determining a target data page from a plurality of data pages of the flash memory block according to the global data page number;
and reading from the initial position of the target data page to find and obtain target firmware.
5. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the firmware storage method of any one of claims 1 to 3 or the firmware search method of claim 4 when executing the computer program.
6. A computer-readable storage medium storing computer-executable instructions for performing the firmware storage method of any one of claims 1 to 3 or the firmware search method of claim 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310465337.9A CN116483280B (en) | 2023-04-26 | 2023-04-26 | Firmware storage method, firmware searching method, device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310465337.9A CN116483280B (en) | 2023-04-26 | 2023-04-26 | Firmware storage method, firmware searching method, device and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116483280A CN116483280A (en) | 2023-07-25 |
CN116483280B true CN116483280B (en) | 2023-11-28 |
Family
ID=87222852
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310465337.9A Active CN116483280B (en) | 2023-04-26 | 2023-04-26 | Firmware storage method, firmware searching method, device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116483280B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7856528B1 (en) * | 2009-08-11 | 2010-12-21 | Texas Memory Systems, Inc. | Method and apparatus for protecting data using variable size page stripes in a FLASH-based storage system |
CN102147771A (en) * | 2011-04-08 | 2011-08-10 | 深圳市江波龙电子有限公司 | Method for finding storage position of firmware program of flash memory device |
CN105190524A (en) * | 2012-12-19 | 2015-12-23 | 马维尔国际贸易有限公司 | Apparatus and method for generating descriptors to transfer data to and from non-volatile semiconductor memory of a storage drive |
WO2020073233A1 (en) * | 2018-10-10 | 2020-04-16 | Alibaba Group Holding Limited | System and method for data recovery in parallel multi-tenancy ssd with finer granularity |
CN113312069A (en) * | 2020-02-27 | 2021-08-27 | 美光科技公司 | Firmware loading for memory controller |
CN113553300A (en) * | 2021-07-27 | 2021-10-26 | 北京字跳网络技术有限公司 | File processing method and device, readable medium and electronic equipment |
CN114237514A (en) * | 2021-12-24 | 2022-03-25 | 深圳市宝佳乐电子科技有限公司 | Block management method, memory controller and memory storage device |
CN115113799A (en) * | 2021-03-18 | 2022-09-27 | 慧荣科技股份有限公司 | Host command execution method and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9400744B2 (en) * | 2012-10-30 | 2016-07-26 | Mangstor, Inc. | Magnetic random access memory journal for multi-level cell flash memory |
US11003780B2 (en) * | 2018-08-03 | 2021-05-11 | Dell Products L.P. | Method and apparatus for validating BIOS firmware using a baseboard management controller |
JP7143735B2 (en) * | 2018-11-15 | 2022-09-29 | Tdk株式会社 | memory controller and memory system |
-
2023
- 2023-04-26 CN CN202310465337.9A patent/CN116483280B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7856528B1 (en) * | 2009-08-11 | 2010-12-21 | Texas Memory Systems, Inc. | Method and apparatus for protecting data using variable size page stripes in a FLASH-based storage system |
CN102147771A (en) * | 2011-04-08 | 2011-08-10 | 深圳市江波龙电子有限公司 | Method for finding storage position of firmware program of flash memory device |
CN105190524A (en) * | 2012-12-19 | 2015-12-23 | 马维尔国际贸易有限公司 | Apparatus and method for generating descriptors to transfer data to and from non-volatile semiconductor memory of a storage drive |
WO2020073233A1 (en) * | 2018-10-10 | 2020-04-16 | Alibaba Group Holding Limited | System and method for data recovery in parallel multi-tenancy ssd with finer granularity |
CN113312069A (en) * | 2020-02-27 | 2021-08-27 | 美光科技公司 | Firmware loading for memory controller |
CN115113799A (en) * | 2021-03-18 | 2022-09-27 | 慧荣科技股份有限公司 | Host command execution method and device |
CN113553300A (en) * | 2021-07-27 | 2021-10-26 | 北京字跳网络技术有限公司 | File processing method and device, readable medium and electronic equipment |
CN114237514A (en) * | 2021-12-24 | 2022-03-25 | 深圳市宝佳乐电子科技有限公司 | Block management method, memory controller and memory storage device |
Also Published As
Publication number | Publication date |
---|---|
CN116483280A (en) | 2023-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10552044B2 (en) | Storage apparatus, data processing method and storage system wherein compressed data is read in parallel, said data stored in buffer by size and read from said buffer, in order of when said data is stored in said buffer | |
US20140189674A1 (en) | Information processing apparatus and information processing method | |
KR100703807B1 (en) | Method and apparatus for managing block by update type of data in block type memory | |
CN106708443B (en) | Data reading and writing method and device | |
CN101002274A (en) | Method and device to improve USB flash write performance | |
US9009442B2 (en) | Data writing method, memory controller and memory storage apparatus | |
CN103942009A (en) | Apparatus and method for extending memory in terminal | |
CN107943727B (en) | High-efficient DMA controller | |
CN111737221A (en) | Data read-write method, device and equipment of cluster file system and storage medium | |
US9524236B1 (en) | Systems and methods for performing memory management based on data access properties | |
CN111966281A (en) | Data storage device and data processing method | |
CN105653539A (en) | Index distributed storage implement method and device | |
CN107430546B (en) | File updating method and storage device | |
CN104133640A (en) | Quick recovery from dormancy | |
CN106528436B (en) | Data storage device and data maintenance method thereof | |
CN116483280B (en) | Firmware storage method, firmware searching method, device and medium | |
US20180285443A1 (en) | Non-transitory computer readable medium, encode device, and encode method | |
US11507799B2 (en) | Information processing apparatus and method of operating neural network computing device therein | |
CN117577163A (en) | SSD bad block detection method, SSD bad block detection device, computer equipment and storage medium | |
US20110307525A1 (en) | Virtual storage device | |
US11907586B2 (en) | Storage device configured to support multi-streams and operation method thereof | |
CN112463055A (en) | Method, system, equipment and medium for optimizing and using L2P table of solid state disk | |
KR20150142250A (en) | Method for operating controller and method for operating device including the same | |
CN104951569A (en) | File system and file management method employing same | |
CN116932426A (en) | Method for managing stored data, electronic device and computer readable storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |