CN115495275B - Storage system and control method thereof - Google Patents

Storage system and control method thereof Download PDF

Info

Publication number
CN115495275B
CN115495275B CN202211429956.4A CN202211429956A CN115495275B CN 115495275 B CN115495275 B CN 115495275B CN 202211429956 A CN202211429956 A CN 202211429956A CN 115495275 B CN115495275 B CN 115495275B
Authority
CN
China
Prior art keywords
firmware
storage system
card
instruction
functional
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
Application number
CN202211429956.4A
Other languages
Chinese (zh)
Other versions
CN115495275A (en
Inventor
祖旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Kangxinwei Storage Technology Co Ltd
Original Assignee
Hefei Kangxinwei Storage Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hefei Kangxinwei Storage Technology Co Ltd filed Critical Hefei Kangxinwei Storage Technology Co Ltd
Priority to CN202211429956.4A priority Critical patent/CN115495275B/en
Publication of CN115495275A publication Critical patent/CN115495275A/en
Application granted granted Critical
Publication of CN115495275B publication Critical patent/CN115495275B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system

Abstract

The invention discloses a storage system and a control method thereof, comprising the following steps: setting a card loop command in a storage system; when the storage system runs the firmware, detecting key parameters of the storage system running the firmware, and if the key parameters are wrong, executing a card loop command by the storage system; acquiring firmware card death error data when a storage system card is dead and firmware card death reason data causing errors of key parameters, wherein the firmware card death error data comprise numerical values of the key parameters which have errors and user information containing the error data, and the firmware card death reason data comprise types of the key parameters which have errors; identifying whether a card loop command is triggered, and setting a firmware card loop mark in a flash memory chip of the storage system when the card loop command is triggered; and if the firmware card death mark is set, when the host sends a recovery command to the storage system, clearing the firmware card death mark and an address mapping table containing user information of error data, and re-running the firmware.

Description

Storage system and control method thereof
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a storage system and a control method thereof.
Background
Firmware (Firmware) refers to a device driver stored inside an electronic device, and through the Firmware, an operating system of the electronic device can implement a specific operation action of a machine according to a standard device driver. Firmware is software that acts as the most basic and bottom layer of an operating system. In a hardware device, the firmware also directly affects the functionality and performance of the hardware device.
In the storage device, due to the complex logic of the firmware, when the firmware has a problem, if some wrong logic or variable errors exist during the operation of the firmware, the problem of the firmware cannot be known in time, and data confusion or data loss can be caused. And for the embedded storage device, it is difficult to take out the memory from the electronic device separately, and the firmware problem may cause the host and even the whole electronic device to be scrapped, and the loss is significant.
Disclosure of Invention
The invention aims to provide a storage system and a control method thereof, which can find and solve the problem of firmware of storage equipment in time.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention provides a control method of a storage system, which comprises the following steps:
setting a card loop command in the storage system;
when the storage system runs the firmware, detecting a key parameter of the storage system running the firmware, and if the key parameter is wrong, executing the card loop instruction by the storage system;
acquiring firmware card death error data when the memory system card is dead and firmware card death reason data causing errors of the key parameters, wherein the firmware card death error data comprise numerical values of the key parameters which have errors and user information containing error data, and the firmware card death reason data comprise types of the key parameters which have errors;
identifying whether the card loop command is triggered or not, and setting a firmware card loop mark in a flash memory chip of the storage system when the card loop command is triggered; and
if the firmware card-dead mark is set, when the host sends a recovery instruction to the storage system, the firmware card-dead mark and an address mapping table of the user information containing error data are cleared, and the firmware is operated again.
In an embodiment of the present invention, detecting the key parameter includes the following steps:
inserting a plurality of key parameter comparison instructions in functional firmware of the storage system;
the functional firmware and the key parameter comparison instruction are operated according to an instruction sequence; and
and when the key parameter comparison instruction is executed, judging whether the key parameter has errors or not according to a preset numerical value threshold range and a preset variable type.
In an embodiment of the present invention, executing the stuck loop instruction includes the following steps:
when the value of the key parameter exceeds the value threshold range and/or the variable type of the key parameter does not accord with the preset variable type, executing the stuck loop instruction; and
before executing the card loop command, the storage system stops initializing the operating environment of the functional firmware.
In an embodiment of the present invention, when the card locking loop instruction is executed, the firmware card locking error data, the firmware card locking reason data, and the functional firmware operation information are recorded, where the functional firmware operation information includes an instruction line number and an instruction content of the functional firmware operation.
In an embodiment of the present invention, the stuck loop instruction includes a write-repeat stuck loop statement.
In an embodiment of the present invention, identifying whether the deadlock loop instruction is triggered includes:
setting a stuck identification instruction in the storage system;
when the storage system runs the functional firmware, the storage system randomly reads the card death recognition instruction and executes the card death recognition instruction;
and when the card death recognition instruction is executed, the storage system judges whether the operation result of the functional firmware is the card death loop statement.
In an embodiment of the present invention, setting the firmware deadlock flag includes the following steps:
forming firmware associated data according to the operating data of the functional firmware;
setting a fixed bit position of the firmware associated data as a firmware card dead zone bit;
setting the firmware card dead zone bit as high-potential data to set the firmware card dead zone mark; and
and writing the firmware associated data into the flash memory chip.
In an embodiment of the present invention, after the firmware deadlock flag is set, before determining whether the recovery instruction is issued, the running process of the functional firmware is returned to the initial end.
In an embodiment of the present invention, the step of returning the running process of the functional firmware to the initial end includes:
judging whether the storage system is a power-off device or not;
when the storage system is a power-off device, the storage system is powered off and powered on again, and the running process of the functional firmware returns to the initial end; and
and when the storage system is a non-outage device, stopping the instruction running process of the storage system, sending an initial end instruction to the storage system, and returning the running process of the functional firmware to the initial end.
The present invention provides a storage system comprising a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of a method of controlling a storage system as hereinbefore described.
As described above, the present invention provides a storage system and a control method thereof, which can repair a memory when a firmware is stuck, thereby reducing the probability of device scrapping due to the firmware being stuck. Moreover, according to the control method of the storage system provided by the invention, whether the firmware is jammed can be found in time, so that the idle running problem of the equipment is reduced, invalid commands sent by the host computer are reduced, the working efficiency of the equipment and the accuracy of firmware running are improved, and the use experience of a user is improved.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a memory system according to an embodiment of the invention.
FIG. 2 is a schematic diagram of a key information storage unit according to an embodiment of the present invention.
FIG. 3 is a flowchart illustrating a control method of a storage system according to an embodiment of the invention.
Fig. 4 is a flowchart of step S20 according to an embodiment of the present invention.
Fig. 5 is a flowchart of step S30 according to an embodiment of the present invention.
Fig. 6 is a diagram illustrating operation results of the storage system in steps S10 to S30 according to an embodiment of the present invention.
FIG. 7 is a flowchart of step S40 according to an embodiment of the present invention.
Fig. 8 is a diagram illustrating operation results of the storage system in steps S10 to S40 according to an embodiment of the present invention.
Fig. 9 is a schematic block diagram of a structure of an electronic device.
Fig. 10 is a schematic block diagram of a structure of a computer-readable storage medium.
In the figure: 10. a host; 20. a storage system; 30. a main controller; 40. a flash memory chip; 50. a data storage module; 60. a key information storage unit; 601. a critical data storage block; 602. a mapping table storage block; 603. a firmware association information storage block; 70. a firmware storage unit; 80. a data storage unit; 90. a processor; 100. a memory; 110. computer instructions; 1101. a computer readable storage medium.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Firmware (Firmware) is a program that is written into an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), or a FLASH Memory (FLASH Memory). The firmware may be upgraded by the user through a specific refresh program. The software that serves as the most Basic and bottom layer of a digital product may be referred to as firmware, such as a Basic Input/output System (BIOS) on a computer motherboard. The firmware can be said to be the neural center of the digital device, which can also be called as the COMBO optical drive operating system, and the COMBO optical drive can only work normally under the control of the firmware. Meanwhile, the firmware also has a plurality of additional functions, such as error correction technology, safe burning technology, playing control technology and the like. In the storage technology, the applied firmware logic is high in complexity and is likely to make mistakes, and particularly, the firmware is applied to an embedded memory (eMMC), and when a firmware problem occurs in the using process of an end user or in the testing process of a downstream manufacturer, the firmware is difficult to repair, and the memory and even the whole electronic device are often scrapped.
Referring to fig. 1, the present invention provides a memory system 20, the memory system 20 includes a host controller 30 and a flash memory chip 40, the host controller 30 is electrically connected to the flash memory chip 40, and the host controller 30 is electrically connected to a host 10. The host 10 may be a computer or a digital device, and the storage system 20 may be an embedded memory. The flash memory chip 40 includes a data storage module 50, wherein the flash memory chip 40 may be a NAND chip, and the data storage module 50 may be a storage array formed by physical blocks (blocks) in the flash memory chip 40. The data storage module 50 may be used to store user data, and the data storage module 50 has non-volatility.
Referring to fig. 1 and 2, in an embodiment of the present invention, the data storage module 50 includes a key information storage unit 60, a firmware storage unit 70, and a data storage unit 80. In this embodiment, the key information storage unit 60 may be a part of a physical block in the data storage module 50, and is used for storing key information of the storage system 20, such as mapping table information, block table calling information, and related information of the firmware. The firmware storage unit 70 is used to store firmware, and before the storage device leaves a factory, the firmware may be burned into the flash memory chip 40 to form the firmware storage unit 70. The data storage unit 80 may be used to store user data. In the present embodiment, the key information storage unit 60 includes a key data storage block 601 and a mapping table storage block 602. The key data storage block 601 may be configured to store key information set in the storage scheme, such as user ID information and log information, which is not limited in the present invention. Mapping table storage block 602 may be used to store an address mapping table from which corresponding data may be retrieved from data storage unit 80. When the data storage unit 80 reads and writes data, a mapping relationship is established between a logical address of the data and an actually stored physical address, an address mapping table is formed, and the address mapping table is stored in the mapping table storage block 602. When the data needs to be called, the physical address of the data may be obtained according to the logical address of the data according to the corresponding address mapping table in the mapping table storage block 602, and then the data may be read according to the physical address of the data. In this embodiment, the key data storage block 601 and the mapping table storage block 602 may be one or more physical blocks in the data storage module 50, or may be one or more physical pages (pages) in the data storage module 50, and the size of the key information storage unit 60 is not limited in the present invention.
Referring to fig. 1 and 2, in an embodiment of the invention, the key information storage unit 60 includes a firmware association information storage block 603. The firmware-related information storage block 603 may be one or more physical blocks in the data storage module 50, or may be one or more physical pages (pages) in the data storage module 50. The firmware-related information storage block 603 may be configured to store a firmware deadlock flag and a reason for firmware deadlock. When the storage system 20 is operated, the main controller 30 calls corresponding firmware from the firmware storage unit 70 according to a control instruction of the host 10, and operates the firmware to perform corresponding operations of the firmware. When a firmware problem occurs, for example, a logic error occurs in a firmware part statement or a variable error occurs due to a hardware characteristic problem of the storage system 20, the main controller 30 cannot execute a corresponding operation when running the firmware, and a data error or even a data loss occurs, and the condition of the firmware error cannot be known in time, so that the loss caused by the firmware problem is difficult to measure. Therefore, the firmware locking mark can be set to distinguish whether the firmware is locked or not, the firmware locking reason can be stored so as to trace the firmware problem, and the running rationality of the firmware is improved.
Referring to fig. 1 to fig. 3, the present invention further provides a control method for a storage system, which can find a firmware problem in time and repair the storage system 20 when the storage system 20 has the firmware problem, and can be applied to repair of the storage device of the end user and device test process of a downstream manufacturer. The control method comprises a step S10.
And step S10, providing the storage system, and setting a card loop command in a firmware storage unit of the storage system.
Referring to fig. 1 and 3, in an embodiment of the present invention, in step S10, the storage system provided may be the storage system 20 shown in the present invention. Among them, a stuck loop instruction is set in the firmware storage unit 70. The firmware storage unit 70 stores therein a card loop instruction and a functional firmware of the storage system 20. The functional firmware is an original firmware burned in the storage system 20, and the storage system 20 can cooperate with the host 10 to realize various functions by operating the functional firmware, thereby realizing various functions of the digital device. The functional firmware may vary from digital device to digital device and application to application, and the present invention is not limited in its specific language. In this embodiment, the stuck-at loop instruction may be a specific program statement, and in the memory system 20, the stuck-at loop instruction is the first priority instruction. The stuck loop command can be burned into the firmware storage unit 70 as a firmware. When the stuck loop command is triggered, the functional firmware will be stalled and the memory system 20 will continue to execute the stuck loop command. Also, in the present embodiment, when the deadlocked loop instruction is executed, the firmware data obtained by the storage system 20 after the functional firmware is executed is not affected. In the storage system 20, since the functional firmware is complicated, there are many possibilities where a firmware problem occurs. Therefore, the control method of the present invention further includes step S20.
Step 20, when the storage system runs the firmware, detecting key parameters of the storage system running the firmware, if the key parameters are wrong, enabling the storage system to execute a card locking loop instruction, and acquiring firmware card locking error data when the storage system is locked and firmware card locking reason data causing the key parameters to be wrong, wherein the firmware card locking error data comprises numerical values of the wrong key parameters and user information containing the error data, and the firmware card locking reason data comprises types of the wrong key parameters.
Referring to fig. 1, fig. 3 and fig. 4, in an embodiment of the present invention, in step S20, when the functional firmware is executed by the storage system 20, the key variables of the storage system 20 are detected multiple times, and whether the execution of the functional firmware is faulty or not is determined. If the functional firmware runs in error, the generation of error data is accompanied. If the functional firmware is not found to be in error in time, the error data can quickly cover the data of the part which is not in error, so that the data is disordered and lost, and the influence is difficult to estimate. Therefore, in step S20, the deadlock loop instruction is executed in time by detecting whether the key variable is faulty, so as to intercept the current firmware running process. Specifically, step S20 includes step S201 to step S207.
Step S201, a plurality of key parameter comparison instructions are inserted into the functional firmware of the storage unit.
Step S202, the instructions in the functional firmware are sequentially run.
Step S203, when executing the key parameter comparison instruction, determining whether the key parameter obtained by running the functional firmware is wrong.
And step S204, when the key parameters obtained by the running functional firmware are wrong, the storage system executes a card loop instruction.
And S205, acquiring and storing the firmware card death reason data according to the error key parameters.
And step S206, acquiring firmware deadlocking error data and firmware operating information according to the operating data of the storage system to the functional firmware.
Step S207, when the key parameter obtained by running the functional firmware is not faulty, the storage system executes the initialization instruction.
Referring to fig. 1, fig. 3 and fig. 4, in an embodiment of the invention, in the running process of the functional firmware, the key parameters include the type of the variable after the program instruction is executed and the parameter value related to the variable. The key parameter comparison instruction may be a program generated by a plurality of program statements, and the key parameter comparison instruction may compare a key parameter obtained by operating the functional firmware with a preset threshold range or a preset variable type, and if the key parameter obtained by operating the functional firmware does not meet the preset threshold range or is not the preset variable type, the functional firmware is considered to be faulty. In step S201, a plurality of critical parameter comparison instructions are inserted in the functional firmware. In the storage system 20, the firmware storage unit 70 includes a plurality of kinds of functional firmware, and each of the functional firmware includes a plurality of program statements. In step S201, a plurality of key parameter comparison instructions are inserted in each functional firmware. In this embodiment, when the key parameter comparison instruction is inserted, the key parameter comparison instruction is set in a program statement after the key parameter is obtained in the functional firmware. Specifically, in the functional firmware, each time the key parameter is obtained, the key parameter comparison instruction may be executed once, and in time, it is discovered whether the key parameter is in error. For example, the functional firmware includes, for example, 900 program statements, and of the 900 program statements, the program statements for obtaining the key parameters are set in, for example, items 10, 320, 580, 880, and so on. Then the key parameter comparison instructions may be placed between the 10 th program statement and the 11 th program statement of the functional firmware, between the 320 th program statement and the 321 th program statement of the functional firmware, between the 580 th program statement and the 581 th program statement of the functional firmware, between the 880 th program statement and the 881 th program statement of the functional firmware, and so on. In step S202, the functional firmware and the key parameter comparison instruction inserted into the functional firmware are sequentially executed in the order of the program statements in the functional firmware. The process of running the functional firmware includes the main controller 30 reading a program statement of the functional firmware from the firmware storage unit 70, and executing an operation corresponding to the read program statement in the main controller 30.
Referring to fig. 3 and 4, in an embodiment of the invention, in step S203, a threshold range of the key parameter is preset. The threshold range may be a critical parameter test result obtained by running the firmware multiple times during the factory test. Specifically, in the process of testing the functional firmware, the application environment function requirements and the like are adjusted to simulate the condition that the user uses the functional firmware, and the running condition of the functional firmware is tested under the simulated test condition to obtain a plurality of items of test data. And presetting a threshold range and a variable type of the functional firmware operation data according to the obtained multiple items of test data. Therefore, in step S203, when the critical parameter comparison command is executed, if the obtained value of the critical parameter is out of the threshold range and/or the variable type of the critical parameter is wrong, the critical parameter is considered to be in error. For example, the functional firmware is used for adjusting the brightness of the mobile phone, if the user requirement is to adjust the brightness of the mobile phone to be the brightest, the key parameter obtained by operating the functional firmware may be the brightness value of the mobile phone, and if the brightness value does not meet the instruction requirement, the key parameter may be considered to be not in accordance with the threshold range, the key parameter has an error, and it may be determined that the mobile phone has a firmware problem. For another example, if the user wants to call out a music function of the mobile phone through voice, and the variable obtained when the functional firmware runs does not correspond to the music function, it can be determined that the time variable type is wrong, and it can be determined that the firmware problem occurs in the mobile phone. The threshold range and the variable type may be determined according to design and testing of the functional firmware, which is not specifically limited in the present invention.
Referring to fig. 1, fig. 3 and fig. 4, in an embodiment of the present invention, when the key parameter is faulty, step S204 is executed to execute the stuck loop instruction. Wherein, upon execution of the stuck-cycle instruction, the storage system 20 stops executing instructions in the functional firmware. If the key parameter has not been faulty, step S207 may be executed to execute the initialization command. The initialization instruction is used for initializing the running environment of the functional firmware. For example, after completing a portion of the instructions of the functional firmware, the current key parameters are correct. To continue executing the functional firmware to achieve the function called by the user, the main controller 30 continuously reads out the corresponding instruction from the firmware storage unit 70 and executes the read instruction, thereby achieving an initialization environment for running the functional firmware. In this embodiment, the instruction content of the functional firmware may be a program statement. The present invention is not limited to the specific form or content of the program statements. The initialization instruction may also be other instructions for providing a running environment for the running firmware, such as acquiring firmware codes, initializing running environment parameters of the main controller 30, and the like.
Referring to fig. 1, fig. 3 and fig. 4, in an embodiment of the present invention, in step S204, after the card loop instruction is executed, the main controller 30 stops fetching the instruction of the functional firmware in the firmware storage unit 70, and executes the card loop instruction repeatedly in a loop. In this embodiment, the stuck-at loop instruction is, for example, a program statement that is written repeatedly. In step S205, if the key parameter is found to be erroneous in step S203, the error data generated by running the functional firmware is acquired and stored while the key parameter is determined to be erroneous. In steps S202 to S204, the storage system 20 generates firmware jam error data, functional firmware operation information, and firmware jam cause data. In this embodiment, the firmware card error data includes the values of the key parameters for error comparison in step S203 and the user information containing the error data. In other embodiments of the present invention, other data generated by instructions related to critical parameters may also be set as firmware deadlock error data. For example, the luminance error is detected, the luminance threshold range is, for example, 1cd/m to 5cd/m, while the luminance value obtained by running the functional firmware in step S203 is, for example, 0.5cd/m, which is out of the threshold range, then the luminance value obtained at this time is 0.5cd/m, which is firmware card death error data. While the function firmware having been executed before obtaining the luminance value 0.5cd/m or obtaining the luminance value 0.5cd/m has obtained the data of the volume 30, the color mode 2, etc., which are also firmware deadlocking error data. The firmware card death error data is acquired and stored in the flash memory chip 40. The function firmware operation information comprises the instruction of the function firmware to be operated to the fourth instruction, the current error function firmware is the fourth instruction, and the instruction content of the current error function firmware.
Referring to fig. 1 to 4, in an embodiment of the invention, the comparison items may be preset and stored in the storage system 20. For example, the color pattern may include a plurality of key parameters such as pixel values, gray scale values, and brightness values. Therefore, when the key parameter has an error in step S203, it can be determined which comparison item has an error according to the content of the error key parameter, and the firmware deadlock cause data is formed. In step S205, the firmware jam cause data is stored in the firmware-associated-information storage block 603. In the embodiment, by running the card loop command, the error field can be effectively saved, so that testers and firmware developers can obtain the error reason of the firmware through analysis, and the functional firmware is improved. Specifically, the reasons for the error of the key parameter include that the value of the key parameter exceeds a threshold range, and the variable is not required. If the manual intervention exists, the specific error position of the functional firmware can be confirmed, and therefore the functional firmware is improved. In the test development process, if the error position of the functional firmware is determined, the functional firmware can be modified through equipment such as a burner. In order to distinguish whether the firmware is jammed, the control method of the storage system of the invention includes step S30.
And S30, identifying whether the card loop command is triggered or not, and setting a firmware card loop flag in a key information storage unit of the storage system when the card loop command is triggered.
Referring to fig. 1, fig. 3 to fig. 5, in an embodiment of the present invention, in step S204, when the loop locked instruction is executed, whether the current loop locked instruction is executed or not can be known by obtaining a loop statement of the loop locked instruction. It is also possible to determine whether the current stuck loop instruction is executed, based on whether the main controller 30 reads out the stuck loop instruction from the firmware storage unit 70. In step S30, a stuck identification command may be set in the firmware storage unit 70 to determine whether a stuck loop command is executed. Specifically, step S30 includes steps S301 to S304.
Step S301, a plurality of dead card identification instructions are set in the firmware storage unit, and the dead card identification instructions are inserted into the functional firmware.
Step S302, judging whether the card loop command is executed.
Step S303, when the card loop instruction is executed, setting a firmware card stop mark in a key information storage unit of the storage system.
And step S304, when the card loop instruction is not executed, continuing to run the functional firmware.
Referring to fig. 1 to fig. 3 and fig. 5, in an embodiment of the present invention, in step S301, the deadlock identification instruction may be a program statement and is used to identify whether the deadlock loop instruction is executed. Specifically, the deadlock loop instruction is, for example, a preset deadlock loop statement written in, and the deadlock identification instruction may identify whether a result of the operation of the functional firmware is the deadlock loop statement. If the loop statement is executed, in step S302, the loop statement is considered to be executed. In the embodiment, the set deadlock loop statement is different from the program statement of the functional firmware, so that the storage system 20 can clearly and quickly identify the deadlock loop statement. In step S303, a firmware stuck flag is set, and the firmware stuck flag may be stored in the firmware-associated-information storage block 603. The firmware-related information storage block 603 includes a plurality of pieces of firmware-related data and firmware deadlock reason data. In this embodiment, a bit in the firmware-associated data is set as the firmware card-dead flag bit. For example, bit 3, for example, of the firmware associated data is set as a firmware stuck flag bit. The default value of the firmware stuck flag is a low level, for example, 0, and if the firmware stuck flag is, for example, 0, the functional firmware of the memory system 20 is normally operating. In step S303, the firmware stuck flag is set to a high potential, for example, 1 when the firmware stuck flag can be set. In this embodiment, if the firmware deadlock flag is, for example, 1, the firmware deadlock occurs in the storage system 20. The firmware-related information storage block 603 includes, for example, 1000 pieces of firmware-related data. In this embodiment, the firmware associated data is used to store data obtained by operating the firmware, and the firmware associated data is continuously updated along with the operation of the functional firmware. The firmware-related information storage block 603 includes, for example, 1000 pieces of firmware-related data. Each time new firmware associated data is written, the firmware associated data written earliest before is overwritten. For example, when the 1001 st data is written, the 1001 st data overwrites the 1 st firmware associated data. In step S304, if the loop stuck instruction is not executed in step S302, the instructions in the functional firmware may continue to be executed in the order of the statements.
Referring to fig. 1 to 3, and fig. 5 and 6, in an embodiment of the invention, in step S301, a deadlock identification command is inserted into the functional firmware. In this embodiment, a plurality of deadlocking identification commands can be randomly inserted into the functional firmware to reduce the complexity of writing and burning the functional firmware. In other embodiments of the present invention, the deadlock identification instruction may also be inserted after the instruction of the key parameter is obtained from the functional firmware, so as to ensure that the deadlock identification instruction can find the execution condition of the deadlock loop instruction in time, and thus when the functional firmware runs in a problem, the running of the functional firmware is stopped in time, so as to reduce the generation of error data, reduce data loss, and quickly and timely set the firmware deadlock flag. It should be noted that the card death recognition instruction is not directly inserted into the functional firmware, but the main controller 30 randomly reads the card death recognition instruction during the running of the functional firmware, and preferentially executes the card death recognition instruction after reading the card death recognition instruction. According to steps S10 to S30 of the present invention, when the firmware has a problem, the functional firmware is not continuously run, as shown in fig. 6, it can be seen in the block labeled 1 that the initialization process of the functional firmware running is continuously failed (Fail), and it can also be seen in the block labeled 2 that the host 10 cannot perform write operation on the storage system 20, so as to avoid data confusion and even data loss caused by the error data covering the original data. In order to solve the firmware error problem, the control method of the storage system according to the present invention further includes step S40.
And step S40, if the firmware card death mark is set, when the host sends a recovery instruction to the storage system, clearing the firmware card death error data and the firmware card death mark, and re-running the firmware.
Referring to fig. 1 to 5 and 7, in an embodiment of the present invention, in step S30, a firmware stuck flag is set in the memory system 20, and the firmware stuck flag is stored in the flash memory chip 40 to prevent the power-off data from being lost. In step S40, after the firmware jam flag is set, the firmware jam problem is handled. Specifically, step S40 includes steps S401 to S412.
Step S401, determining whether the firmware jam flag is set, if the firmware jam flag is set, executing step S402, and if the firmware jam flag is not set, executing step S407.
Step S402, determining whether the storage system is a power-off device, if the storage system is a power-off device, performing step S403, and if the storage system is not a power-off device, performing step S405.
And step S403, powering off the storage system to return the running process of the functional firmware to the initial end.
And step S404, powering on the storage system again.
And step S405, stopping the instruction running process of the storage system.
Step S406, the running process of the functional firmware is returned to the initial end.
Step 407, initializing the operating environment of the functional firmware.
Step S408, determining whether the firmware deadlock flag is set, if the firmware deadlock flag is set, executing step S409, and if the firmware deadlock flag is not set, executing step S407.
Step S409 is to determine whether the host issues a recovery command to the storage system, if so, step S410 is executed, and if not, step S412 is executed.
Step S410, clearing the address mapping table of the user information containing the error data and the firmware card-dead mark.
Step S411 is to rerun the functional firmware from the initial end of the functional firmware.
And step S412, reserving the firmware error field.
Referring to fig. 1 to 5 and fig. 7, in an embodiment of the present invention, in step S401, it is determined whether the firmware card-dead flag is set. The step of confirming whether the firmware deadlock flag is set includes finding the latest written firmware-related data in the firmware-related information storage block 603. In the storage scheme provided in this embodiment, the firmware-related information storage block 603 includes firmware deadlock reason data and a firmware deadlock flag. In step S401, the latest firmware associated data is found according to the writing time of the data or the calling sequence of the data block, and the firmware deadlock flag is found from the latest firmware associated data. If the firmware deadlock flag is, for example, 1, it is determined that the firmware deadlock flag is set, and the operation of the functional firmware is faulty, step S402 is executed. If the firmware deadlock flag is, for example, 0, it is determined that the firmware deadlock flag is not set, the functional firmware normally runs, and step S407 is executed to initialize the running environment of the functional firmware to run the functional firmware.
Referring to fig. 1 to 5 and fig. 7, in an embodiment of the invention, in step S402, it is determined whether the memory system 20 is a power-off device. Wherein, whether the storage system 20 is a power-off device can be confirmed according to the application environment of the user terminal and the user requirement. For example, if the user terminal is a device such as a mobile phone or a tablet that can be powered off immediately, in step S402, it is determined that the storage system 20 is a device that can be powered off. For example, if the user terminal is a device such as an experimental device that cannot be powered off immediately and the power off may affect the acquisition of the experimental data, in step S402, it is determined that the storage system 20 is a device that cannot be powered off. In this embodiment, in step S402, the storage system 20 may be set as a power-off-capable device or a power-off-incapable device before shipment or use of the device. In other embodiments of the present invention, in step S402, the user may also be asked whether to accept immediate power off during the use of the user terminal. If the user accepts immediate power down, step S403 and step S404 are executed. If the user does not accept the immediate power down, step S405 and step S406 are performed. If the control method of the storage system according to the present invention is applied to a test environment, the storage system 20 may be a power-off device.
Referring to fig. 1 to 5 and fig. 7, in an embodiment of the present invention, in step S402, if the memory system 20 is a power-off device, step S403 is performed. In step S403, the power of the storage system 20 is cut off, and the running process of the functional firmware is returned to the initial end. In this embodiment, the main controller 30 retrieves the program instructions of the functional firmware from the firmware storage unit 70 of the flash memory chip 40, and then runs the functional firmware. In the process of operating the functional firmware by the main controller 30, if power failure occurs, the stored data in the flash memory chip 40 can be saved, and the operating data in the main controller 30 is completely lost. Therefore, in step S403, the power is cut off to the storage system 20, and the running process of the functional firmware can be returned to the initial end directly. In complex functional firmware, a power-off can quickly interrupt the running process of the functional firmware and return the running process of the firmware to the initial end. For example, the functional firmware includes, for example, 1000 program statements, and when the stuck-at loop instruction is executed, the main controller 30 executes, for example, 750 th program statement to the functional firmware, and the running process of the functional firmware can be returned to the 1 st program statement by powering off. In step S404, the memory system 20 is powered on again.
Referring to fig. 1 to 5 and 7, in an embodiment of the invention, in step S402, if the memory system 20 is an uninterruptible device, step S405 and step S406 are executed. In step S405, the instruction execution process of the storage system 20 is stopped. Specifically, the memory system 20 is stopped by a plurality of instructions such as a stuck loop instruction, a functional firmware instruction, and a stuck identification instruction. In step S405, the main controller 30 stops executing the stuck loop instruction and also stops reading the functional firmware and the stuck identification instruction from the firmware storage unit 70. In step S406, the running process of the functional firmware is returned to the initial end. The initial end instruction may be preset back in the firmware storage unit 70. When all the instructions are stopped in step S405, the main controller 30 may acquire the back-end instruction from the firmware storage unit 70, thereby returning the operation of the functional firmware to the initial end. Specifically, for example, return to the first program statement of the functional firmware.
Referring to fig. 1 to fig. 5 and fig. 7, in an embodiment of the present invention, after the processing branches of step S403 and step S404 and the processing branches of step S405 and step S406, the running process of the functional firmware returns to the initial end, and step S408 is executed to determine whether the firmware deadlock flag is set. In step S408, if the firmware jam flag is not set, step S407 is executed to initialize the operating environment of the functional firmware. In step S408, if the firmware deadlock flag is set, step S409 is executed to determine whether the host 10 issues a recovery command to the storage system 20. In step S409, if the host 10 does not issue a recovery command to the storage system 20, step S412 is executed to reserve a firmware error field. In this embodiment, in step S412, after the firmware error field is reserved, the reason for the firmware error may be analyzed through manual intervention. In the test process of the storage system 20, if the firmware is in error, the functional firmware can be improved by analyzing the reason of the firmware error. Wherein, during the test process, the host 10 may be a burner. After analyzing the error cause, the host 10 may issue a recovery command to the storage system 20 again, so as to execute step S410 and step S411.
Referring to fig. 1 to 5, and fig. 7 and 8, in an embodiment of the present invention, if the host 10 issues a recovery command to the host controller 30, step S410 is executed to clear the address mapping table and the firmware deadlock flag of the user information containing the error data. In step S410, the clearing of the firmware card death error data may only clear the user data containing the error information, and specifically may clear the address mapping table of the user data in the mapping table storage block 602, so as to facilitate the recovery of the data. Clearing the firmware stuck flag may be setting the firmware stuck flag of the firmware associated data to a low potential, e.g., 0. In step S410, the data of the cause of the firmware deadlock is retained, so that the firmware developer can better and faster analyze the problem location, and can more quickly and perfectly update the functional firmware of the storage system 20. In step S409, if the functional firmware has an error in the user terminal, the host 10 may directly send a recovery instruction to the storage system 20 to quickly recover the use environment of the user. In this embodiment, if the recovery command is CMD56+ Argu 0xFF000002, for example, in the test environment of the memory system 20, the specific content of the recovery command is not limited in the present invention. In step S411, the functional firmware is re-run from the initial end of the functional firmware. During the re-running process of the functional firmware, the value of the key parameter with the error can be initialized or overwritten along with the re-running of the functional firmware, so that the value is updated to the correct key parameter. As shown in fig. 8, by the control method provided by the present invention, it can be seen that the host 10 can initialize the storage system 20 as shown in block 3, and the host 10 can write data to the storage system 20 as shown in block 4.
Referring to fig. 9, the present invention further provides an electronic device, where the electronic device includes a processor 90 and a memory 100, the memory 100 stores program instructions, and the processor 90 executes the program instructions to implement the control method of the storage system. The Processor 90 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component; the Memory 100 may include a Random Access Memory (RAM) and may further include a Non-Volatile Memory (Non-Volatile Memory), such as at least one disk Memory. The Memory 100 may also be an internal Memory of Random Access Memory (RAM) type, and the processor 90 and the Memory 100 may be integrated into one or more independent circuits or hardware, such as: application Specific Integrated Circuit (ASIC). It should be noted that the computer program in the memory 100 may be implemented in the form of software functional units and stored in a computer readable storage medium 1101 when being sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention.
Referring to fig. 10, the present invention further provides a computer-readable storage medium 1101, where the computer-readable storage medium 1101 stores computer instructions 110, and the computer instructions 110 are configured to enable the computer to execute the method for controlling the storage system. The computer readable storage medium 1101 may be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system or propagation medium. The computer-readable storage medium 1101 may also include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a Random Access Memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Optical disks may include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-RW), and DVD.
The embodiments of the invention disclosed above are intended merely to aid in the explanation of the invention. The examples are not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims (10)

1. A method of controlling a storage system, comprising the steps of:
setting a card loop command in the storage system, wherein the card loop command comprises a program statement which is repeatedly written;
when the storage system runs the firmware, detecting a key parameter of the storage system running the firmware, and if the key parameter is wrong, executing the card loop instruction by the storage system;
acquiring firmware card death error data when the memory system card is dead and firmware card death reason data causing errors of the key parameters, wherein the firmware card death error data comprise numerical values of the key parameters which have errors and user information containing error data, and the firmware card death reason data comprise types of the key parameters which have errors;
identifying whether the card loop command is triggered or not, and setting a firmware card loop mark in a flash memory chip of the storage system when the card loop command is triggered; and
if the firmware card-dead mark is set, when the host sends a recovery instruction to the storage system, the firmware card-dead mark and an address mapping table of the user information containing error data are cleared, and the firmware is operated again.
2. The method of claim 1, wherein detecting the key parameter comprises:
inserting a plurality of key parameter comparison instructions in functional firmware of the storage system;
the functional firmware and the key parameter comparison instruction are operated according to an instruction sequence; and
and when the key parameter comparison instruction is executed, judging whether the key parameter has errors or not according to a preset numerical value threshold range and a preset variable type.
3. The method of claim 2, wherein executing the stuck loop instruction comprises:
when the value of the key parameter exceeds the value threshold range and/or the variable type of the key parameter does not accord with the preset variable type, executing the stuck loop instruction; and
and before the deadlocked loop instruction is executed, the storage system stops initializing the operating environment of the functional firmware.
4. The method according to claim 3, wherein the firmware deadlock error data and the firmware deadlock reason data are recorded, and the functional firmware running information is recorded when the deadlock loop instruction is executed, wherein the functional firmware running information comprises the instruction line number and the instruction content of the functional firmware running.
5. The method according to claim 4, wherein the stuck loop instruction includes a repeat write stuck loop statement.
6. The control method of the storage system according to claim 5, wherein the step of identifying whether the stuck loop command is triggered comprises the steps of:
setting a card death recognition instruction in the storage system;
when the storage system runs the functional firmware, the storage system randomly reads the card death recognition instruction and executes the card death recognition instruction;
and when the card death recognition instruction is executed, the storage system judges whether the operation result of the functional firmware is the card death loop statement.
7. The method of claim 2, wherein setting the firmware deadlock flag comprises:
forming firmware associated data according to the operating data of the functional firmware;
setting a fixed bit position of the firmware associated data as a firmware card dead zone bit;
setting the firmware card dead zone bit as high-potential data to set the firmware card dead zone mark; and
and writing the firmware associated data into the flash memory chip.
8. The method according to claim 2, wherein after the firmware deadlock flag is set, the running process of the functional firmware is returned to an initial end before determining whether the recovery instruction is issued.
9. The method according to claim 8, wherein the step of returning the running process of the functional firmware to the initial end comprises:
judging whether the storage system is a power-off device or not;
when the storage system is a power-off device, the storage system is powered off and powered on again, and the running process of the functional firmware returns to the initial end; and
when the storage system is not powered off, stopping the instruction running process of the storage system, sending an initial end instruction back to the storage system, and returning the running process of the functional firmware to the initial end.
10. A storage system, characterized in that it comprises a computer-readable storage medium storing computer instructions which, when executed by a processor, implement the steps of a control method of a storage system according to any one of claims 1 to 9.
CN202211429956.4A 2022-11-16 2022-11-16 Storage system and control method thereof Active CN115495275B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211429956.4A CN115495275B (en) 2022-11-16 2022-11-16 Storage system and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211429956.4A CN115495275B (en) 2022-11-16 2022-11-16 Storage system and control method thereof

Publications (2)

Publication Number Publication Date
CN115495275A CN115495275A (en) 2022-12-20
CN115495275B true CN115495275B (en) 2023-03-24

Family

ID=85115754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211429956.4A Active CN115495275B (en) 2022-11-16 2022-11-16 Storage system and control method thereof

Country Status (1)

Country Link
CN (1) CN115495275B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806893A (en) * 2024-02-29 2024-04-02 合肥康芯威存储技术有限公司 Processing method of abnormal data of memory device and memory device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949426A (en) * 2019-05-16 2020-11-17 北京兆易创新科技股份有限公司 Firmware program error detection method and device and storage equipment
CN115113905A (en) * 2022-08-29 2022-09-27 摩尔线程智能科技(北京)有限责任公司 Firmware upgrading method and firmware upgrading device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6968477B2 (en) * 2002-03-07 2005-11-22 International Business Machines Corporation System and method for system surveillance using firmware progress code
KR20200076886A (en) * 2018-12-20 2020-06-30 에스케이하이닉스 주식회사 Storage device and operating method thereof
KR20210024763A (en) * 2019-08-26 2021-03-08 에스케이하이닉스 주식회사 Apparatus and method for handling firmware error in operation of memory system
CN114138600A (en) * 2021-11-25 2022-03-04 苏州浪潮智能科技有限公司 Storage method, device, equipment and storage medium for firmware key information
CN115237753A (en) * 2022-06-24 2022-10-25 广州致存科技有限责任公司 Firmware debugging method, system, terminal equipment and storage medium
CN115185734A (en) * 2022-07-25 2022-10-14 苏州忆联信息系统有限公司 Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949426A (en) * 2019-05-16 2020-11-17 北京兆易创新科技股份有限公司 Firmware program error detection method and device and storage equipment
CN115113905A (en) * 2022-08-29 2022-09-27 摩尔线程智能科技(北京)有限责任公司 Firmware upgrading method and firmware upgrading device

Also Published As

Publication number Publication date
CN115495275A (en) 2022-12-20

Similar Documents

Publication Publication Date Title
KR101019209B1 (en) Device of automatically extracting Interface of Embedded Software and Method thereof
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
TWI470420B (en) Dubugging method and computer system using the smae
JP2008009721A (en) Evaluation system and evaluation method thereof
US20080163001A1 (en) Method for facilitating BIOS testing
CN115495275B (en) Storage system and control method thereof
CN115756984A (en) Memory test method, device, equipment and storage medium
CN113315675B (en) White box switch U-Boot automatic testing method, system and storage medium
CN113377586A (en) Automatic server detection method and device and storage medium
US20090259835A1 (en) System and method for tracking and recording system configurations of electronic devices
TW201301023A (en) System and method for testing a mother board
US10922023B2 (en) Method for accessing code SRAM and electronic device
CN114780421A (en) Abnormity testing method, system and storage medium based on virtual instruction set platform
JP2009223714A (en) Arithmetic circuit and failure analysis method of arithmetic circuit
CN113721992A (en) BIOS starting method and related device of server
CN107704270B (en) Two-out-of-two architecture-based method and device for starting and guiding micro computer/operating system (μ C/OS-II)
CN108279991B (en) Method for quickly positioning problem of computer equipment halt rate
CN112445670A (en) eMMC test method and device
US20090187755A1 (en) Computer System and Method for Recording Operating Information Thereof
CN117806893A (en) Processing method of abnormal data of memory device and memory device
TWI764581B (en) Memory check method, memory check device and memory check system
JP2012118739A (en) Storage device and control method
KR100759590B1 (en) Method for initializing flash memory of mobile device and recording medium recorded program according to the method
WO2015147829A1 (en) System and method of run-time continuous memory check for embedded systems
CN114297064A (en) Processor error reporting positioning method, device, equipment and storage medium

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