Test method, device and equipment of firmware module and storage medium
Patent Information
- Application Number
- CN202311646293.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-12-01
AI Technical Summary
[0003]通常在测试过程中,固件工程师需要通过烘烤、过炉等手段注入错误,但是通过烘烤过炉等手段会出现数据出现的错误不可控,无法精准的在数据中注入错误
[0041]本申请在读取数据的时,通过主动修改原始测试数据中的部分数据内容,使得数据发生测试人员想要的错误,相对于通过烘烤、过炉等手段注入错误的方案来说,本申请的方案实现了精准的在原始测试数据中注入错误,提升固件模块的测试准确性,从而提高固件模块开发效率。
Smart Images

Figure CN117746964B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of firmware testing technology, and in particular to a method, apparatus, device and storage medium for testing firmware modules. Background Technology
[0002] After the initial design of the firmware module for the memory chip is completed, firmware engineers need to conduct white-box testing to expose any design flaws. White-box testing involves artificially creating various errors to simulate problems the product might encounter during actual operation. The firmware module's handling of these abnormal events is then observed to ensure it meets expectations, allowing for timely corrections.
[0003] During testing, firmware engineers typically need to inject errors through methods such as baking and reflowing. However, these methods can lead to uncontrollable errors in the data, making it impossible to accurately inject errors into the data. Summary of the Invention
[0004] The purpose of this application is to provide a testing method, apparatus, device, and storage medium for firmware modules, which can accurately inject errors into the data, improve testing accuracy, and increase firmware module development efficiency.
[0005] This application discloses a testing method for a firmware module, including the following steps:
[0006] Receive raw test data from the flash memory module, modify the raw test data according to specific error instructions to obtain the test data;
[0007] The test data is then subjected to error correction to obtain the post-test data.
[0008] The post-test data is compared with the original test data to determine whether the post-test data and the original test data are consistent and to generate a comparison result. Based on the comparison result, it is determined whether the error handling capability of the firmware module is qualified.
[0009] Optionally, the step of receiving the raw test data in the flash memory module and modifying the raw test data according to a specific error instruction to obtain the test data includes:
[0010] Receive raw test data;
[0011] According to the specific error instruction, the start position and end position of the first active error data are set in the original test data;
[0012] Set the number of bits for the first active error data and the first flip mode;
[0013] Within the starting and ending positions of the first active error data in the original test data, according to the first flipping mode, a number of bits of the first active error data are selected for bit flipping operation to complete the specific error modification and obtain the test data.
[0014] Optionally, the first flipping mode includes a random flipping mode and a continuous flipping mode;
[0015] When the first flip mode is the continuous flip mode, the start position and end position of the first continuous flip data are set according to the number of bits of the first active error data in the start position and end position of the first active error data, and bit flip operation is performed on the data from the start position to the end position of the first continuous flip data.
[0016] When the first flipping mode is the random flipping mode, bit flipping operations are performed on randomly selected data at the start position and end position of the first active error data, based on the number of bits in the first active error data and a preset random algorithm.
[0017] Optionally, before the step of setting the start position and end position of the first active error data in the original test data according to the specific error instruction, the method further includes:
[0018] Identify the number of bits and the location of the initial error data in the original test data;
[0019] The step of performing a bit-flipping operation on a number of bits of the first active error data within the start and end positions of the first active error data in the original test data, according to the first flipping mode, to complete the specific error modification and obtain the test data includes:
[0020] Based on the first flip mode and the number of bits of the first active error data minus the number of bits of the initial error data, data other than the initial error data position is selected for bit flipping operation to complete the specific error modification and obtain the test data.
[0021] Optionally, before the step of setting the start position and end position of the first active error data in the original test data according to the specific error instruction, the method further includes:
[0022] Identify the number of bits and the location of the initial error data in the original test data;
[0023] Perform a bit-flipping operation on the data at the position of the initial erroneous data in the original test data.
[0024] Optionally, after comparing the post-test data with the original test data to determine whether the post-test data and the original test data are consistent and generating a comparison result, and judging whether the error handling capability of the firmware module is qualified based on the comparison result, the method further includes:
[0025] If the firmware module meets the requirements, the original test data in the flash memory will be received again.
[0026] Set the start position and end position of the second active error data;
[0027] Set the number of bits for the second active error data and the second flip mode;
[0028] Within the start and end positions of the second active error data in the original test data, according to the second flipping mode, select the number of bits of the second active error data to perform a bit flipping operation, complete the specific error modification, and obtain the test data;
[0029] The number of bits in the second active error data is equal to the number of bits in the first active error data plus a preset value.
[0030] Optionally, the firmware module includes a flash conversion module and an error checking and correction module, wherein the error checking and correction module is connected between the flash conversion module and the flash module;
[0031] The firmware module performs error correction processing on the test data to obtain post-test data; the post-test data is compared with the original test data to determine whether the post-test data and the original test data are consistent and a comparison result is generated; the step of judging whether the error handling capability of the firmware module is qualified based on the comparison result includes:
[0032] The error checking and correction module receives the data to be tested, checks and corrects it to obtain the corrected data.
[0033] The flash memory conversion module receives the error-corrected data and the processing report from the error checking and correction module, compares the error-corrected data with the original test data, determines whether the error-corrected data is consistent with the original test data and generates a comparison result, and judges whether the error handling capability of the firmware module meets the requirements based on the comparison result.
[0034] This application also discloses a flash memory device, which includes an interface, a firmware module, an error injection module, and multiple flash memory modules, wherein the interface, the firmware module, the error injection module, and the multiple flash memory modules are connected in sequence;
[0035] The interface is used to connect with external devices and exchange raw test data; the firmware module is used to control the conversion and processing of raw test data; the error injection module is used to perform bit flipping on some data in the raw test data; the flash memory module is used to store the raw test data.
[0036] This application also discloses an electronic device, the electronic device comprising:
[0037] At least one processor; and,
[0038] A memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the testing method of the firmware module as described above.
[0040] This application also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the testing method for the firmware module described above.
[0041] This application, when reading data, actively modifies some data content in the original test data to introduce errors that testers want. Compared with methods that inject errors through baking, reflowing, etc., this application's solution achieves precise injection of errors into the original test data, improving the testing accuracy of firmware modules and thus increasing firmware module development efficiency. Attached Figure Description
[0042] The accompanying drawings, which form part of the specification, are used to provide a further understanding of the embodiments of this application and illustrate the implementation methods of this application, together with the textual description, to explain the principles of this application. Obviously, the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any creative effort. In the drawings:
[0043] Figure 1 This is a schematic diagram of a firmware module testing method according to an embodiment of this application;
[0044] Figure 2 This is a schematic diagram of a bit-flipping method according to an embodiment of this application;
[0045] Figure 3 This is a schematic diagram of a method for multiple tests according to an embodiment of this application;
[0046] Figure 4 This is a schematic diagram of a flash memory device according to an embodiment of this application;
[0047] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of this application.
[0048] Among them, 10 is an electronic device; 11 is a memory; 12 is a processor; 13 is a display; 14 is a network interface; 20 is a flash memory device; 21 is an interface; 22 is a firmware module; 23 is an error injection module; and 24 is a flash memory module. Detailed Implementation
[0049] It should be understood that the terminology, specific structural and functional details used herein are merely for describing particular embodiments and are representative. However, this application may be implemented in many alternative forms and should not be construed as being limited to the embodiments set forth herein.
[0050] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating relative importance or implying the number of technical features indicated. Therefore, unless otherwise stated, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature; those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0051] The present application will now be described in detail with reference to the accompanying drawings and optional embodiments.
[0052] This invention provides a testing method for firmware module 22. The execution subject of the testing method for firmware module 22 includes, but is not limited to, at least one of the electronic devices 10 that can be configured to execute the method provided in this application embodiment, such as a client or a mobile terminal. The mobile terminal includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster.
[0053] Figure 1 This is a schematic diagram of a firmware module testing method according to an embodiment of this application, as shown below. Figure 1 As shown, this application discloses a testing method for firmware module 22, including the following steps:
[0054] S1: Receive the raw test data from the flash memory module, modify the raw test data according to specific error instructions, and obtain the test data;
[0055] S2: Perform error correction on the test data to obtain the post-test data;
[0056] S3: Compare the post-test data with the original test data to determine whether the post-test data and the original test data are consistent and generate comparison results. Based on the comparison results, determine whether the error handling capability of the firmware module is qualified.
[0057] The original test data is stored in the flash memory module. The firmware module 22 obtains the original test data from the flash memory module 20. Specific error instructions include bit flipping, adding, and deleting some data in the original test data. The error correction processing behavior of the firmware module 22 based on the test data includes checking the test data, correcting errors in the test data, and outputting reread data.
[0058] When reading the original test data, this application actively modifies some of the data content in the original test data to make the original test data contain the errors that the testers want. Compared with the solution of injecting errors through baking, reflowing, etc., the solution of this application achieves precise injection of errors into the original test data, improves the testing accuracy of firmware module 22, and thus improves the development efficiency of firmware module 22.
[0059] Firmware module 22 includes a flash memory conversion module and an error checking and correction module. Of course, the error checking and correction module can also be separate from firmware module 22. For example, firmware module 22 includes a flash memory conversion module and an error checking and correction module.
[0060] Firmware module 22 includes a flash memory conversion module and an error checking and correction module;
[0061] Step S3: The firmware module performs error correction processing on the test data to obtain the post-test data; the post-test data is compared with the original test data to determine whether the post-test data and the original test data are consistent and a comparison result is generated. The steps to determine whether the error handling capability of the firmware module is qualified based on the comparison result include:
[0062] S31: The error checking and correction module receives the data to be tested, checks and corrects errors to obtain the corrected data;
[0063] S32: The flash memory conversion module receives the error-corrected data and the processing report from the error checking and correction module, compares the error-corrected data with the original test data, determines whether the test data is consistent with the original test data and generates a comparison result, and judges whether the error handling capability of the firmware module meets the requirements based on the comparison result.
[0064] For example: When there are data errors in the test data, the error checking and correction module receives the test data, checks and corrects the errors to obtain corrected data, and compares the corrected data with the original test data to determine whether there are still erroneous data in the corrected data. If there are still erroneous data, the error handling capability of the firmware module 22 is deemed unqualified; if there are no erroneous data, the error handling capability of the firmware module 22 is deemed qualified.
[0065] Taking the error checking and correction module as an example, which is independent of the firmware module 22, the error checking and correction module receives the test data output by the error injection module 23, checks and corrects the test data, and transmits the corrected data and processing report to the firmware module 22. The firmware module 22 executes the corresponding steps according to the corrected data and processing report. The tester checks whether the corresponding steps executed by the firmware module 22 meet the expectations, thereby determining whether the firmware module 22 meets the design requirements.
[0066] For example: When there are data errors in the test data, the error checking and correction module receives the test data, checks and corrects it to obtain corrected data. If the error data exceeds the threshold and cannot be corrected, the module transmits a processing report to the firmware module 22. Based on the corrected data and the processing report, if the firmware module 22 generates a reread data command, it is determined that the error handling capability of the firmware module 22 is qualified. If no reread data command is generated, the error handling capability of the firmware module 22 is determined to be unqualified.
[0067] like Figure 2 As shown, the further step S1: receiving the raw test data from the flash memory module, modifying the raw test data according to specific error instructions to obtain the test data includes:
[0068] S11: Receive raw test data;
[0069] S12: Set the start position and end position of the first active error data in the original test data according to the specific error instruction;
[0070] S13: Set the number of bits for the first active error data and the first flip mode;
[0071] S14: Within the starting and ending positions of the first active error data in the original test data, according to the first flip mode, select the number of bits of the first active error data to perform a bit flip operation, complete the specific error modification, and obtain the test data.
[0072] This application receives the original test data through the error injection module 23 and performs bit flipping operations on the set data in the original test data to achieve precise injection of different error types. The order of steps S11: receiving the original test data; S12: setting the start position and end position of the first active error data in the original test data according to the specific error instruction; S13: setting the number of bits and the first flipping mode of the first active error data can be changed and is not limited here.
[0073] Specifically, when the first flip mode is a continuous flip mode, the start position and end position of the first continuous flip data are set according to the number of bits of the first active error data in the start position and end position of the first active error data, and bit flipping operation is performed on the data from the start position to the end position of the first continuous flip data.
[0074] When the first flipping mode is a random flipping mode, bit flipping operations are performed on randomly selected data at the start and end positions of the first active error data, based on the number of bits in the first active error data and a preset random algorithm. The preset random algorithm includes a linear congruential method, i.e., a linear congruential random number generator.
[0075] Furthermore, in order to inject precise-type errors into the original test data, this application also identifies data in the original test data that has already undergone bit flipping during transmission before injecting errors into the original test data, as follows:
[0076] Before step S12: setting the start and end positions of the first active error data in the original test data according to the specific error instruction, the following steps are included:
[0077] S111: Identify the number of bits of initial error data and the location of initial error data in the original test data;
[0078] Furthermore, within the starting and ending positions of the first active error data in the original test data, according to the first flip mode, the data of the number of bits of the first active error data is selected for bit flipping operation to complete the specific error modification and obtain the test data. This includes selecting data other than the initial error data position based on the first flip mode and the number of bits of the first active error data minus the number of bits of the initial error data, and performing bit flipping operation to complete the specific error modification and obtain the test data.
[0079] This prevents errors generated during the transmission of the original test data from affecting the test. For example, when the error injection module 23 is set to inject 72-bit / 1KB errors into the original test data, if there are already 5-bit errors in the original error, the actual error will be 77-bit, thus affecting the accuracy of the firmware module 22 test.
[0080] Of course, after identifying the number of bits and the location of the initial error data in the original test data, we can also correct and revise the data at the location of the initial error data. Specifically:
[0081] Before step S12: setting the start and end positions of the first active error data in the original test data according to the specific error instruction, the following steps are also included:
[0082] S111: Identify the number of bits of initial error data and the location of initial error data in the original test data;
[0083] S112: Perform a bit flip operation on the data at the position of the initial error data in the original test data.
[0084] That is, by using the error injection module 23, the error data at the position of the initial misaligned data in the original test data is first flipped to make the number of bits of the initial error data in the original test data zero. In this way, in step S12: the start position and end position of the first active error data are set in the original test data according to the specific error instruction; and in step S13: the number of bits of the first active error data and the first flip mode are set. During the operation, it is not necessary to consider the number of bits and the position of the initial error data, and the operation algorithm is also simpler.
[0085] Figure 3 This is a schematic diagram of a method for multiple tests according to an embodiment of this application, as shown below. Figure 3 As shown, after step S3: comparing the post-test data with the original test data to determine whether the post-test data and the original test data are consistent and generating a comparison result, and judging whether the error handling capability of the firmware module is qualified based on the comparison result, the following steps are also included:
[0086] S4: If the firmware module meets the requirements, then re-receive the original test data from the flash memory;
[0087] S5: The start position of the second active error data and the end position of the second active error data;
[0088] S6: Set the number of bits for the second active error data and the second flip mode;
[0089] S7: Within the starting and ending positions of the second active error data in the original test data, according to the second flip mode, select the number of bits of the second active error data to perform a bit flip operation, complete the specific error modification, and obtain the test data;
[0090] The number of bits in the second active error data is equal to the number of bits in the first active error data plus a preset value. The preset value can be positive or negative, and is not limited here.
[0091] In step S7: Within the starting and ending positions of the second active error data in the original test data, according to the second flip mode, select the number of bits of the second active error data to perform a bit flip operation, complete the specific error correction, and obtain the test data; then, in step S3: the firmware module performs error correction processing on the test data to obtain the post-test data; compare the post-test data with the original test data to determine whether the post-test data is consistent with the original test data and generate a comparison result, and based on the comparison result, determine whether the error handling capability of the firmware module is qualified.
[0092] For example, if the limit that the error checking and correction module of a firmware module 22 can handle in its initial design is 72 bits / 1KB, then the number of bits of the first active error data set during the first test can be 72 bits / 1KB, and the number of bits of the second active error data set during the second test can be 73 bits / 1KB or 71 bits / 1KB. This allows for the simultaneous assessment of the error correction capability of the error checking and correction module and the error handling capability of the firmware module 22.
[0093] Figure 4 This is a schematic diagram of a flash memory device according to an embodiment of this application, as shown below. Figure 4 As shown, this application also discloses a flash memory device 20, which includes an interface 21, a firmware module 22, an error injection module 23, and multiple flash memory modules 24. The interface 21, firmware module 22, error injection module 23, and multiple flash memory modules 24 are connected in sequence. The interface 21 is used to connect with external devices to exchange raw test data. The firmware module 22 is used to control the conversion and processing of raw test data. The error injection module 23 is used to perform bit flipping on some data in the raw test data. The flash memory modules 24 are used to store the raw test data.
[0094] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of this application, as shown below. Figure 5As shown, this application also discloses an electronic device 10, which includes: at least one processor 12; and a memory 11 communicatively connected to the at least one processor 12; wherein the memory 11 stores instructions executable by the at least one processor 12, which are executed by the at least one processor 12 to enable the at least one processor 12 to execute the test method of the firmware module 22 described above.
[0095] Specifically, the electronic device 10 includes, but is not limited to, a memory 11, a processor 12, a display 13, and a network interface 14. The electronic device 10 connects to a network via the network interface 14 to acquire raw test data. The network can be an intranet, the Internet, GSM, WCDMA, 4G, 5G, Bluetooth, Wi-Fi, or a wireless or wired network.
[0096] The memory 11 includes at least one type of readable medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 10, such as the hard disk or memory of the electronic device 10. In other embodiments, the memory 11 may also be an external storage device of the electronic device 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. of the electronic device 10. Of course, the memory 11 may include both internal storage units and external storage devices of the electronic device 10. In this embodiment, the memory 11 is typically used to store the operating system and various application software installed on the electronic device 10, such as the program code of the test method of firmware module 22. In addition, the memory 11 may also be used to temporarily store various types of data that have been output or will be output.
[0097] In some embodiments, processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor 12, or other data processing chip. This processor 12 is typically used to control the overall operation of electronic device 10, such as performing data interaction or communication-related control and processing. In this embodiment, processor 12 is used to run program code stored in memory 11 or process data, such as running program code for the test method of firmware module 22.
[0098] The display 13 may be referred to as a display screen or display unit. In some embodiments, the display 13 may be an LED display 13, a liquid crystal display 13, a touch-sensitive liquid crystal display 13, and an organic light-emitting diode (OLED) touch screen, etc. The display 13 is used to display information processed in the electronic device 10 and to display a visual working interface, such as displaying the results of data statistics.
[0099] The network interface 14 may optionally include a standard wired interface 21 or a wireless interface 21 (such as a Wi-Fi interface 21), which is typically used to establish a communication connection between the electronic device 10 and other electronic devices 10.
[0100] Figure 5 Only an electronic device 10 with a test method including a memory 11, a processor 12, a display 13, a network interface 14, and a firmware module 22 is shown. However, it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0101] Optionally, the electronic device 10 may further include a user interface, which may include a display, an input unit such as a keyboard, and optionally a standard wired interface or a wireless interface. Optionally, in some embodiments, the display 13 may be an LED display 13, a liquid crystal display 13, a touch-sensitive liquid crystal display 13, or an organic light-emitting diode (OLED) touchscreen, etc. The display 13 may also be appropriately referred to as a display screen or display unit, used to display information processed in the electronic device 10 and to display a visual user interface.
[0102] The electronic device 10 may also include radio frequency (RF) circuits, sensors, and audio circuits, etc., which will not be described in detail here.
[0103] In the above embodiments, when the processor 12 executes the test of the firmware module 22 stored in the memory 11, it can perform the following steps:
[0104] Receive raw test data from the flash memory module, modify the raw test data according to specific error instructions to obtain the test data;
[0105] The test data is corrected to obtain the post-test data.
[0106] The post-test data is compared with the original test data to determine whether the post-test data is consistent with the original test data and to generate a comparison result. Based on the comparison result, it is determined whether the error handling capability of the firmware module is qualified.
[0107] Furthermore, this embodiment of the invention also proposes a computer-readable medium, which can be non-volatile or volatile. This computer-readable medium can be any one or any combination of several of the following: hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory 11 (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, etc. The computer-readable medium includes a data storage area and a program storage area. The data storage area stores data created based on the use of blockchain nodes, and the program storage area stores the test method for the firmware module. When the test method for the firmware module is executed by the processor 12, it performs the following operations:
[0108] Receive raw test data from the flash memory module, modify the raw test data according to specific error instructions to obtain the test data;
[0109] The test data is corrected to obtain the post-test data.
[0110] The post-test data is compared with the original test data to determine whether the post-test data is consistent with the original test data and to generate a comparison result. Based on the comparison result, it is determined whether the error handling capability of the firmware module is qualified.
[0111] It should be noted that, through the above description of the embodiments, those skilled in the art can clearly understand that the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, electronic device, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0112] It should be noted that the limitations on each step involved in this solution are not considered as limiting the order of steps, provided that they do not affect the implementation of the specific solution. The steps listed first can be executed first, later, or even simultaneously. As long as this solution can be implemented, it should be considered to fall within the scope of protection of this application.
[0113] It should be noted that the inventive concept of this application can form many embodiments, but due to the limited space of the application documents, they cannot all be listed. Therefore, without conflict, the embodiments described above or the technical features can be arbitrarily combined to form new embodiments. After the embodiments or technical features are combined, the original technical effect will be enhanced.
[0114] The above description, in conjunction with specific optional embodiments, provides a further detailed explanation of this application and should not be construed as limiting the specific implementation of this application to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of this application, and all such modifications or substitutions should be considered within the scope of protection of this application.
Claims
1. A method for testing a firmware module, characterized in that, Including the following steps: Receive raw test data from the flash memory module, modify the raw test data according to specific error instructions to obtain the test data; The test data is then subjected to error correction to obtain the post-test data. The post-test data is compared with the original test data to determine whether the post-test data and the original test data are consistent and to generate a comparison result. Based on the comparison result, it is determined whether the error handling capability of the firmware module is qualified. The step of receiving the raw test data from the flash memory module and modifying the raw test data according to specific error instructions to obtain the test data includes: Receive raw test data; According to the specific error instruction, the start position and end position of the first active error data are set in the original test data; Set the number of bits for the first active error data and the first flip mode; Within the starting and ending positions of the first active error data in the original test data, according to the first flipping mode, select the number of bits of the first active error data to perform a bit flipping operation to complete the specific error modification and obtain the test data; Before the step of setting the start position and end position of the first active error data in the original test data according to the specific error instruction, the method further includes: Identify the number of bits and the location of the initial error data in the original test data; The step of performing a bit-flipping operation on a number of bits of the first active error data within the start and end positions of the first active error data in the original test data, according to the first flipping mode, to complete the specific error modification and obtain the test data includes: Based on the first flip mode and the number of bits of the first active error data minus the number of bits of the initial error data, data other than the initial error data position is selected for bit flipping operation to complete specific error modification and obtain the test data; this prevents the influence of errors generated during the transmission of the original test data on the test.
2. The testing method for the firmware module according to claim 1, characterized in that, The first flipping mode includes a random flipping mode and a continuous flipping mode; When the first flip mode is the continuous flip mode, the start position and end position of the first continuous flip data are set according to the number of bits of the first active error data in the start position and end position of the first active error data, and bit flip operation is performed on the data from the start position to the end position of the first continuous flip data. When the first flipping mode is the random flipping mode, bit flipping operation is performed on randomly selected data at the start position and end position of the first active error data, according to the number of bits of the first active error data and a preset random algorithm.
3. The testing method for the firmware module according to claim 1, characterized in that, After comparing the post-test data with the original test data to determine whether the post-test data and the original test data are consistent and generating a comparison result, and judging whether the error handling capability of the firmware module is qualified based on the comparison result, the method further includes: If the firmware module meets the requirements, the original test data in the flash memory will be received again. Set the start position and end position of the second active error data; Set the number of bits for the second active error data and the second flip mode; Within the start and end positions of the second active error data in the original test data, according to the second flipping mode, select the number of bits of the second active error data to perform a bit flipping operation, complete the specific error modification, and obtain the test data; The number of bits in the second active error data is equal to the number of bits in the first active error data plus a preset value.
4. The testing method for the firmware module according to claim 1, characterized in that, The firmware module includes a flash memory conversion module and an error checking and correction module, wherein the error checking and correction module is connected between the flash memory conversion module and the flash memory module; The firmware module performs error correction processing on the test data to obtain post-test data; the post-test data is compared with the original test data to determine whether the post-test data and the original test data are consistent and a comparison result is generated; the step of judging whether the error handling capability of the firmware module is qualified based on the comparison result includes: The error checking and correction module receives the data to be tested, checks and corrects it to obtain the corrected data. The flash memory conversion module receives the error-corrected data and the processing report from the error checking and correction module, compares the error-corrected data with the original test data, determines whether the error-corrected data is consistent with the original test data and generates a comparison result, and judges whether the error handling capability of the firmware module meets the requirements based on the comparison result.
5. A flash memory device, characterized in that, The flash memory device is used to perform the test method of the firmware module as described in any one of claims 1-4. The flash memory device includes an interface, a firmware module, an error injection module, and multiple flash memory modules, wherein the interface, the firmware module, the error injection module, and the multiple flash memory modules are connected in sequence. The interface is used to connect with external devices and exchange raw test data; the firmware module is used to control the conversion and processing of raw test data; the error injection module is used to perform bit flipping on some data in the raw test data; the flash memory module is used to store the raw test data.
6. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform a test method for the firmware module as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the test method for the firmware module as described in any one of claims 1 to 4.
Citation Information
Patent Citations
A method and apparatus for testing error checking and correction capabilities.
CN102279776A
Flash interface error injector, injection method and system
CN103839593A