Method, device, equipment and storage medium for optimizing RAM storage space
By scanning and parsing the flash memory, the storage space is allocated according to the space length of the bad column information table, which solves the problem that the bad column information table cannot be stored in completeness due to limited RAM space, and ensures the accuracy and stability of the flash memory data.
Patent Information
- Application Number
- CN202410225377.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-02-29
AI Technical Summary
In the prior art, because the RAM space is limited, the fixed space length will be pre-configured for each type of flash information table during firmware design, resulting in the inability to store complete bad column information tables, affecting the accuracy and stability of flash storage data. sex.
By scanning the flash memory, analyzing the bad column information, allocating the corresponding variable start address and fixed end address according to the space length of the bad column information table, and storing the bad column information table in RAM to ensure its integrity.
It realizes the allocation of appropriate storage space in RAM according to the quality of flash memory to store bad column information tables, ensuring the accuracy and stability of flash memory storage data.
Smart Images

Figure CN118331488B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of flash memory technology, and in particular to a method for optimizing RAM storage space. Background Art
[0002] Flash memory is one of the mainstream storage media and is widely used in various types of storage products. In order to ensure the performance, security and reliability of storage products, flash memory needs to be equipped with a storage control chip to perform data writing, reading and erasing tasks. In order to effectively manage flash memory, it is necessary to use various flash memory information tables stored in random access memory (RAM).
[0003] In the related art, since the RAM space is limited, the firmware design will pre-configure a fixed space length for each type of flash information table for storage. The bad column information table is an important information table that records the number of bad columns, distribution location and other parameters of the flash memory. Its size will vary depending on the quality of the flash memory. If a fixed area of space is allocated in the RAM to store this table, it is very likely that the complete bad column information table will not be stored, which will affect the accuracy and stability of the flash memory storage data. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method for optimizing RAM storage space, which can allocate appropriate storage space in RAM to store bad column information table according to the quality of flash memory, thereby ensuring the accuracy and stability of flash memory storage data.
[0005] A first aspect of the present application provides a method for optimizing RAM storage space, comprising:
[0006] Scan the flash memory and parse out the bad column information of the flash memory;
[0007] Based on the bad column information of the flash memory, the bad column information is concretely represented according to a preset processing rule to obtain a bad column information table, and the length of space to be occupied by the bad column information table is calculated;
[0008] According to the length of the space to be occupied by the bad column information table, a corresponding space address is allocated, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the length of the space to be occupied by the bad column information table;
[0009] A corresponding storage space is allocated to the bad column information table in the RAM according to the space address, and the space address of the bad column information is stored.
[0010] Furthermore, in one embodiment, the preset processing rules include:
[0011] Add a flag to the current bad column bit of the flash memory;
[0012] According to the offset between the current bad column byte point and the previous bad column byte point, the byte offset corresponding to the current bad column byte point is obtained;
[0013] According to the bit position of the current bad column bit point, an error bit position corresponding to the current bad column bit point is obtained;
[0014] The identification bit, the byte offset bit and the error bit are used to form a bad column identification data body, and the above steps are repeated until all the bad column bytes of the flash memory are processed, and all the obtained bad column identification data bodies are used to form a bad column information table, and a tail identification bit is added to the end of the bad column information table.
[0015] Further, in one of the embodiments, scanning the flash memory and parsing the bad column information of the flash memory includes:
[0016] Perform programming of the flash memory;
[0017] Read and verify the data programmed into the flash memory, and parse out the bad column information of the flash memory based on the verification result.
[0018] Further, in one of the embodiments, parsing the bad column information of the flash memory based on the verification result includes:
[0019] If the number of errors of the bit positions corresponding to the current bit column is greater than or equal to the preset error bit threshold, the current bit column is determined to be a bad column;
[0020] If the number of bad columns corresponding to the current byte point is greater than or equal to a preset bad column error threshold, the current byte point is determined to be a bad column byte point;
[0021] The bad column information of the flash memory is parsed according to the bad column and the bad column bit.
[0022] A second aspect of the present application provides a device for optimizing RAM storage space, comprising:
[0023] A scanning module is used to scan the flash memory and parse out the bad column information of the flash memory;
[0024] A representation module, for representing the bad column information in a representation manner according to a preset processing rule based on the bad column information of the flash memory, obtaining a bad column information table, and calculating the length of space to be occupied by the bad column information table;
[0025] an allocation module, configured to allocate a corresponding space address according to the space length to be occupied by the bad column information table, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the space length to be occupied by the bad column information table;
[0026] A storage module is used to allocate corresponding storage space to the bad column information table in the RAM according to the space address, and store the space address of the bad column information.
[0027] Furthermore, in one embodiment, the preset processing rules include:
[0028] Add a flag to the current bad column bit of the flash memory;
[0029] According to the offset between the current bad column byte point and the previous bad column byte point, the byte offset corresponding to the current bad column byte point is obtained;
[0030] According to the bit position of the current bad column bit point, an error bit position corresponding to the current bad column bit point is obtained;
[0031] The identification bit, the byte offset bit and the error bit are used to form a bad column identification data body, and the above steps are repeated until all the bad column bytes of the flash memory are processed, and all the obtained bad column identification data bodies are used to form a bad column information table, and a tail identification bit is added to the end of the bad column information table.
[0032] Furthermore, in one embodiment, the scanning module includes:
[0033] A programming unit, used for performing programming on the flash memory;
[0034] The verification unit is used to read and verify the data programmed into the flash memory, and parse out the bad column information of the flash memory based on the verification result.
[0035] Further, in one of the embodiments, the verification unit is used to parse out bad column information of the flash memory based on the verification result, including:
[0036] If the number of errors of the bit positions corresponding to the current bit column is greater than or equal to the preset error bit threshold, the current bit column is determined to be a bad column;
[0037] If the number of bad columns corresponding to the current byte point is greater than or equal to a preset bad column error threshold, the current byte point is determined to be a bad column byte point;
[0038] The bad column information of the flash memory is parsed according to the bad column and the bad column bit.
[0039] A third aspect of the present application provides an electronic device, including:
[0040] Processor; and
[0041] A memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method for optimizing RAM storage space as described above.
[0042] A fourth aspect of the present application provides a computer-readable storage medium storing executable code, which, when executed by a processor of an electronic device, causes the processor to execute the method for optimizing RAM storage space as described above.
[0043] The technical solution of the present application includes: scanning the flash memory and parsing the bad column information of the flash memory; based on the bad column information of the flash memory, the bad column information is concretely represented according to the preset processing rules to obtain a bad column information table, and the length of the space to be occupied by the bad column information table is calculated; according to the length of the space to be occupied by the bad column information table, the corresponding space address is allocated, wherein the space address includes a variable starting address and a fixed end address, and the difference between the starting address and the end address is equal to the length of the space to be occupied by the bad column information table; according to the space address, the corresponding storage space is allocated to the bad column information table in the RAM, and the space address of the bad column information is stored. The present application can allocate appropriate storage space in the RAM to store the bad column information table according to the quality of the flash memory, thereby ensuring the accuracy and stability of the data stored in the flash memory. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 It is a flowchart of a method for optimizing RAM storage space shown in an embodiment of the present application;
[0046] Figure 2 is a flow chart of a method for optimizing RAM storage space shown in another embodiment of the present application;
[0047] Figure 3 FIG. 1 is a schematic diagram of the structure of a device for optimizing RAM storage space in an embodiment of the present application;
[0048] Figure 4 FIG. 1 is a schematic diagram of the structure of a device for optimizing RAM storage space in an embodiment of the present application;
[0049] Figure 5 Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application;
[0050] Figure 6 Shown is a structural schematic diagram of the internal space structure diagram of the RAM in the storage control chip in one embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to facilitate the understanding of the present invention, the present invention will be described more comprehensively with reference to the accompanying drawings. The preferred embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thoroughly understood.
[0052] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0054] In order to ensure the performance, security and reliability of storage products, flash memory needs to be equipped with a storage control chip to jointly perform tasks such as data writing, reading, and erasing. The storage control chip manages the flash memory through various flash memory information tables stored in the RAM. Before performing data writing, reading, or erasing tasks, it will read the relevant flash memory information table to read the characteristics of the flash memory, so as to operate the flash memory.
[0055] like Figure 6 The figure shows the internal space structure of RAM in the storage control chip. Figure 6It can be seen that the RAM storage space is, from top to bottom, the firmware internal code storage area, Buffer area (buffer), Partition table storage area, RN table storage area, BC table storage area (bad column information table storage area), Retry table storage area (reread voltage threshold table storage area), mass production information table storage area (MP table storage area), pointer storage area, reserved area, global variable storage area, stack area and firmware external code storage area.
[0056] In order to fit most flash memory, the firmware internal code usually has a larger storage space area, so there is generally no shortage of storage space. However, the size of the buffer area, retry table storage area, MP table storage area, pointer storage area, reserved area, global variable storage area, stack area and firmware external code storage area is not closely related to the quality of the flash memory. Therefore, the space size of the above storage areas in RAM is fixed, and because the internal space structure of RAM is based on Figure 6 The structure is arranged in order, so the starting address and end address of each area can also be configured in advance. The Partition table, RN table and BC table will vary with the quality of the flash memory, especially the BC table is greatly affected by the quality of the flash memory. In the related technology, because the size of the bad column information table varies with flash memories of different qualities, if a fixed area of space is divided in the RAM to store this table, it is very likely that the complete bad column information table cannot be stored, which will affect the accuracy and stability of the flash memory storage data.
[0057] Therefore, in order to solve the above technical problems, the present application discloses a method for optimizing RAM storage space, which can allocate appropriate storage space in RAM to store the bad column information table according to the quality of flash memory, thereby ensuring the accuracy and stability of flash memory storage data.
[0058] The technical solution of the present application is described in detail below with reference to the accompanying drawings.
[0059] Figure 1 Shown is a flow chart of a method for optimizing RAM storage space in one embodiment of the present application.
[0060] See also Figure 1 , a method for optimizing RAM storage space, comprising the following steps:
[0061] Step S110: Scan the flash memory and parse out bad column information of the flash memory.
[0062] It should be noted that there are two ways to parse out the bad column information of the flash memory. The first is to perform a full disk read / write scan on the flash memory, and the second is to perform a partial read / write scan on the flash memory. Full disk read / write scan, this method can obtain the most complete and accurate bad column information, but it takes a long time and is suitable for medium and low quality flash memory. Partial read / write scan, by scanning the bad column information of several blocks to represent the entire flash memory, takes a short time, but may not be able to obtain the most complete and accurate bad column information, this method is suitable for high-quality flash memory. Whether it is a full disk read / write scan or a partial read / write scan, the principle of the solution is the same, that is, first send a programming (write) instruction to the flash memory, write the data to the flash memory block, then read the data in the flash memory block and perform verification, compare the data before writing with the data after reading, and then parse out the bad column of the current flash memory.
[0063] Step S120: Based on the bad column information of the flash memory, the bad column information is concretely represented according to a preset processing rule to obtain a bad column information table, and the length of space to be occupied by the bad column information table is calculated.
[0064] It should be noted that after completing the read / write scan to obtain the bad column information of the flash memory, the bad column information is concretely represented according to the preset processing rules. Since the bad column is a real "physical defect column" for the flash memory, but the firmware, as an embedded system software running inside the storage control chip, cannot identify these real "physical defect columns", therefore, it is necessary to concretely process the bad column information and then "inform" the firmware that these defective physical columns are bad columns. On the other hand, because the storage control chip itself does not have strong computing power, the firmware in the storage control chip can only control the flash memory to implement tasks such as writing, reading, and erasing data. Therefore, it is necessary to use the computing power of the host system to parse the bad column information of the flash memory through software, and then the software uses the preset bad column identification data body to form a bad column information table, which is sent to the firmware, and the firmware is informed of the content, length, etc. of the bad column information table.
[0065] In this embodiment, the preset processing rules include: adding an identification bit to the current bad column byte point of the flash memory; obtaining the byte offset bit corresponding to the current bad column byte point according to the offset between the current bad column byte point and the previous bad column byte point; obtaining the error bit bit corresponding to the current bad column byte point according to the bit position of the current bad column byte point; using the identification bit, the byte offset bit and the error bit bit to form a bad column identification data body, repeating the above steps until all bad column byte points of the flash memory are processed, forming a bad column information table with all the obtained bad column identification data bodies, and adding a tail identification bit at the end of the bad column information table.
[0066] The bad column information is concretely represented according to the preset processing rule, and can be represented by referring to the bad column identification data body in Table 1.
[0067] Identification bit Byte offset Error bit
[0068] Table 1
[0069] The bad column identification data body is a 32-bit data body, in which the identification bit occupies 6 bits in the bad column identification data body. The value of the identification bit is fixed and pre-configured. The firmware can know that the bad column information table is being read, that is, the bad column identification data body corresponding to the current byte through the identification bit. The byte offset bit occupies 16 bits of the bad column identification data body. The value of the byte offset bit is based on the offset address of the current byte and the previous byte. When the value of the byte offset bit is equal to 2b'0000 0000 0000 0000, it means that the first byte has a bad pixel. The error bit occupies 8 bits in the bad column identification data body, which indicates which bit of the current byte has a bad pixel. If it appears, it means that the current byte has a bad pixel. Since the bad column identification data body is 32 bits, a preset bad column identification data body is a 4-byte data body structure. When the bad column information table of the flash memory includes 100 bad column identification data bodies, it means that the length of the bad column information table = 100*4Byte = 400Byte. In addition, the bad column information table has a length. The end of the bad column information table is marked by inserting 0xFF at the end of the last bad column identification data body. Therefore, the length of the bad column information table = 400 + 1 = 401 Bytes.
[0070] Step S130, according to the length of the space to be occupied by the bad column information table, a corresponding space address is allocated, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the length of the space to be occupied by the bad column information table.
[0071] After the bad column information table is sent to the firmware, the firmware allocates a corresponding space address to the bad column information table in the RAM according to the size of the bad column information table, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the length of the space occupied by the bad column information table. Since the storage space of the RAM is, from top to bottom, the firmware internal code storage area, the buffer area, the partition table storage area, the RN table storage area, the BC table storage area, the retry table storage area, the MP table storage area, the pointer storage area, the reserved area, the global variable storage area, the stack area, and the firmware external code storage area, and the space size of the firmware internal code storage area, the buffer area, the retry table storage area, the MP table storage area, the pointer storage area, the reserved area, the global variable storage area, the stack area, and the firmware external code storage area is fixed, therefore, the end address of the bad column information table is fixed (the end address of the bad column information table is the start address of the retry table), and based on the length of the bad column information table, the start address of the bad column information table can be configured (the start address of the bad column information table is the end address of the RN table).
[0072] Step S140: Allocate corresponding storage space to the bad column information table in the RAM according to the space address, and store the space address of the bad column information.
[0073] It should be noted that the corresponding storage space is allocated to the bad column information table in the RAM according to the space address, and the space address of the bad column information is stored. Since the bad column information table is obtained based on the bad column identification data body on the basis of performing a read / write scan on the flash memory, the length of the bad column information table is in line with the quality level of the current flash memory, and the length of the bad column information table is in line with the current flash memory. The space configured in the RAM will not be unable to store the complete bad column information table, which will affect the accuracy and security of subsequent flash memory storage data.
[0074] Figure 2 Shown is a flow chart of a method for optimizing RAM storage space in another embodiment of the present application.
[0075] See also Figure 2 , a method for optimizing RAM storage space, comprising the following steps:
[0076] Step S210: Execute programming of the flash memory.
[0077] Based on the data sheet (DataSheet) corresponding to the flash memory, refer to the data sheet to send the corresponding programming instructions and the data to be programmed to the flash memory to complete the programming operation of the flash memory. It should be noted that programming is the operation of writing to the flash memory. When performing the programming operation on the flash memory, it can be implemented in two ways. The first is to perform a full disk write on the flash memory, and the second is to perform a partial write on the flash memory. Full disk write means programming all blocks (Blocks) of the flash memory, while partial write means randomly selecting some blocks in the flash memory for programming. The programming principles of the two are the same, and the only difference is the number of programming blocks.
[0078] Step S220: read and verify the data programmed into the flash memory, and parse out bad column information of the flash memory based on the verification result.
[0079] After completing the programming operation on the flash memory, in order to obtain the bad column information of the flash memory, it is also necessary to read and verify the data programmed into the flash memory, and parse the bad column information of the flash memory based on the verification result. It should be noted that if a full disk write is performed, the data in all blocks of the flash memory need to be read and verified. If a partial write is performed, the data in some blocks of the flash memory need to be read and verified. The reading and verification principles of the two are the same, and the only difference is the number of blocks read and verified.
[0080] Among them, parsing the bad column information of the flash memory based on the verification result can be implemented as follows: if the number of errors in the bit position corresponding to the current bit column is greater than or equal to the preset error bit threshold, the current bit column is determined to be a bad column; if the number of bad columns corresponding to the current byte point is greater than or equal to the preset error bad column threshold, the current byte point is determined to be a bad column byte point; based on the bad columns and bad column byte points, the bad column information of the flash memory is parsed.
[0081] In order to better understand the technical solution of the present application, the technical solution of the present embodiment is described with a specific case. Assuming that all blocks of the flash memory include 8 pages, each page is 8 bytes, if 1 bit of erroneous data occurs in each byte, after reading and checking by the firmware, the information shown in Table 2 is obtained.
[0082]
[0083] Table 2
[0084]
[0085] Table 3
[0086] The data in Table 2 and Table 3 are parsed by the computing power of the host. According to the data in Table 2, in the current byte, the number of errors (8 bits) of the bits corresponding to the 0th column bit column are all errors, which is greater than the preset error bit threshold (in this embodiment, the preset error bit threshold is set to 50%), so the 0th column bit column is determined to be a bad column. According to the data in Table 3, for each byte of each page in the block, the probability of error is 40%, 60%, 0%, 0%, 0%, 0%, 0%, 0%, 0%, 0% and 100%, respectively. Since the probability of the 0th byte of the 0th column and the 7th byte of the 7th column is greater than the preset error bad column threshold (in this embodiment, the preset error bad column threshold is set to 50%), the 0th column and the 7th column are marked as bad column byte points. Therefore, the page template of the flash memory is 1011 1110.
[0087] Step S230: Based on the bad column information of the flash memory, the bad column information is concretely represented according to a preset processing rule to obtain a bad column information table, and the length of space to be occupied by the bad column information table is calculated.
[0088] By concretely representing the data in Table 2 and Table 3 according to the preset processing rules, the bad column identification data bodies in Table 4 and Table 5 can be obtained.
[0089] Fixed position Byte offset Error bit 2b’0000 01 2b’0000 0000 000 0001 2b’0000 0001
[0090] Table 4
[0091] Fixed position Byte offset Error bit 2b’0000 01 2b’0000 0000 0000 1000 2b’0000 0001
[0092] Table 5
[0093] The preset bad column identification data bodies in Table 4 and Table 5 are combined into a bad column information table, and 0xFF is added to the end to obtain the bad column information table shown in Table 6.
[0094]
[0095] Table 6
[0096] The length of the bad column information table in Table 6 = 4 + 4 + 1 = 9 bytes.
[0097] The bad column information table is sent to the firmware, and the firmware receives the bad column information table and stores it in RAM and flash memory (the flash memory is used for backup, because the data will disappear once the RAM is powered off, and the storage control chip needs to read the bad column information table in the flash memory and load it into RAM when it is powered on next time).
[0098] Step S240, according to the length of the space to be occupied by the bad column information table, a corresponding space address is allocated, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the length of the space to be occupied by the bad column information table.
[0099] After the bad column information table is sent to the firmware, the firmware allocates a corresponding space address to the bad column information table in the RAM according to the size of the bad column information table, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the length of the space occupied by the bad column information table. Since the storage space of the RAM is, from top to bottom, the firmware internal code storage area, the buffer area, the partition table storage area, the RN table storage area, the BC table storage area, the retry table storage area, the MP table storage area, the pointer storage area, the reserved area, the global variable storage area, the stack area, and the firmware external code storage area, and the space size of the firmware internal code storage area, the buffer area, the retry table storage area, the MP table storage area, the pointer storage area, the reserved area, the global variable storage area, the stack area, and the firmware external code storage area is fixed, therefore, the end address of the bad column information table is fixed (the end address of the bad column information table is the start address of the retry table), and based on the length of the bad column information table, the start address of the bad column information table can be configured (the start address of the bad column information table is the end address of the RN table).
[0100] Step S250: Allocate corresponding storage space to the bad column information table in the RAM according to the space address, and store the space address of the bad column information.
[0101] It should be noted that the corresponding storage space is allocated to the bad column information table in the RAM according to the space address, and the space address of the bad column information is stored. Since the bad column information table is obtained based on the bad column identification data body on the basis of performing a read / write scan on the flash memory, the length of the bad column information table is in line with the quality level of the current flash memory, and the length of the bad column information table is in line with the current flash memory. The space configured in the RAM will not be unable to store the complete bad column information table, which will affect the accuracy and security of subsequent flash memory storage data.
[0102] Corresponding to the aforementioned method embodiments, the present application also discloses a device for optimizing RAM storage space and corresponding embodiments.
[0103] Figure 3 Shown is a schematic structural diagram of a device for optimizing RAM storage space in one embodiment of the present application.
[0104] See also Figure 3 , a device 300 for optimizing RAM storage space includes: a scanning module 310, a representation module 320, an allocation module 330 and a storage module 340. Among them:
[0105] The scanning module 310 is used to scan the flash memory and parse out the bad column information of the flash memory.
[0106] The representation module 320 is used to represent the bad column information in a representation manner according to a preset processing rule based on the bad column information of the flash memory, obtain a bad column information table, and calculate the length of space to be occupied by the bad column information table.
[0107] The allocation module 330 is used to allocate corresponding space addresses according to the space length to be occupied by the bad column information table, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the space length to be occupied by the bad column information table.
[0108] The storage module 340 is used to allocate corresponding storage space to the bad column information table in the RAM according to the space address, and store the space address of the bad column information.
[0109] Furthermore, in this embodiment, the preset processing rules include: adding an identification bit to the current bad column byte point of the flash memory; obtaining the byte offset bit corresponding to the current bad column byte point according to the offset between the current bad column byte point and the previous bad column byte point; obtaining the error bit bit corresponding to the current bad column byte point according to the bit position of the current bad column byte point; using the identification bit, the byte offset bit and the error bit position to form a bad column identification data body, repeating the above steps until all bad column byte points of the flash memory are processed, forming a bad column information table with all the obtained bad column identification data bodies, and adding a tail identification bit at the end of the bad column information table.
[0110] It should be noted that the method for optimizing RAM space implemented by the device for optimizing RAM space disclosed in this embodiment is the same as the above embodiment, so it will not be described in detail here. Optionally, each module in this embodiment and the above other operations or functions are respectively for implementing the methods in the above embodiments.
[0111] Figure 4 Shown is a schematic structural diagram of a device for optimizing RAM storage space in another embodiment of the present application.
[0112] See also Figure 4 , a device 300 for optimizing RAM storage space includes: a scanning module 310, a representation module 320, an allocation module 330 and a storage module 340. The scanning module 310 includes a programming unit 311 and a verification unit 312.
[0113] The functions of the scanning module 310, the image module 320, the allocation module 330 and the storage module 340 are shown in FIG. Figure 3 , I will not go into details here.
[0114] The programming unit 311 is used to perform programming on the flash memory.
[0115] The verification unit 312 is used to read and verify the data programmed into the flash memory, and parse out the bad column information of the flash memory based on the verification result.
[0116] Furthermore, in the present embodiment, when the check unit 312 parses out the bad column information of the flash memory based on the check result, it can be implemented as follows: if the number of errors in the bit corresponding to the current bit column is greater than a preset error bit threshold, the current bit column is determined to be a bad column; if the number of bad columns corresponding to the current byte point is greater than a preset error bad column threshold, the current byte point is determined to be a bad column byte point; based on the bad columns and bad column byte points, the bad column information of the flash memory is parsed.
[0117] It should be noted that the method for optimizing RAM space implemented by the device for optimizing RAM space disclosed in this embodiment is the same as the above embodiment, so it will not be described in detail here. Optionally, each module in this embodiment and the above other operations or functions are respectively for implementing the methods in the above embodiments.
[0118] See also Figure 5 Another embodiment of the present application shows a computing electronic device 500 including: a processor 510 and a memory 520.
[0119] The processor 510 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0120] A general purpose processor may be a microprocessor or the processor may be any conventional processor. The memory 510 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage.
[0121] Among them, ROM can store static data or instructions required by processor 520 or other modules of the computer. The permanent storage device can be a readable and writable storage device. The permanent storage device can be a non-volatile storage device that does not lose the stored instructions and data even if the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device.
[0122] In some other embodiments, the permanent storage device may be a removable storage device (e.g., a floppy disk, an optical drive). The system memory may be a read-write storage device or a volatile read-write storage device, such as a dynamic random access memory. The system memory may store some or all of the instructions and data required by the processor at run time.
[0123] In addition, the memory 520 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (eg, DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic disks and / or optical disks.
[0124] In some embodiments, the memory 520 may include a removable storage device that can be read and / or written, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, and a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not contain a carrier wave and an instantaneous electronic signal transmitted wirelessly or by wire. The memory 520 stores executable code, and when the executable code is processed by the processor 510, the processor 510 can execute part or all of the methods described above.
[0125] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0126] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.
[0127] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for optimizing RAM storage space, characterized in that: include: Scan the flash memory and parse out the bad column information of the flash memory; Based on the bad column information of the flash memory, the bad column information is concretely represented according to a preset processing rule to obtain a bad column information table, and the length of space to be occupied by the bad column information table is calculated, wherein the preset processing rule includes: adding an identification bit to the current bad column byte point of the flash memory; obtaining the byte offset corresponding to the current bad column byte point according to the offset between the current bad column byte point and the previous bad column byte point; obtaining the error bit corresponding to the current bad column byte point according to the bit of the current bad column byte point; using the identification bit, the byte offset bit and the error bit to form a bad column identification data body, repeating the above steps until all the bad column byte points of the flash memory are processed, forming a bad column information table with all the obtained bad column identification data bodies, and adding a tail identification bit at the end of the bad column information table; According to the length of the space to be occupied by the bad column information table, a corresponding space address is allocated, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the length of the space to be occupied by the bad column information table; A corresponding storage space is allocated to the bad column information table in the RAM according to the space address, and the space address of the bad column information is stored.
2. The method for optimizing RAM storage space according to claim 1, characterized in that: Scanning the flash memory and parsing the bad column information of the flash memory includes: Perform programming of the flash memory; Read and verify the data programmed into the flash memory, and parse out the bad column information of the flash memory based on the verification result.
3. The method for optimizing RAM storage space according to claim 2, characterized in that: The step of parsing the bad column information of the flash memory based on the verification result includes: If the number of errors of the bit positions corresponding to the current bit column is greater than or equal to the preset error bit threshold, the current bit column is determined to be a bad column; If the number of bad columns corresponding to the current byte point is greater than or equal to a preset bad column error threshold, the current byte point is determined to be a bad column byte point; The bad column information of the flash memory is parsed according to the bad column and the bad column bit.
4. A device for optimizing RAM storage space, characterized in that: include: A scanning module is used to scan the flash memory and parse out the bad column information of the flash memory; A concrete module is used to make a concrete representation of the bad column information based on the bad column information of the flash memory according to a preset processing rule, obtain a bad column information table, and calculate the length of space to be occupied by the bad column information table, wherein the preset processing rule includes: adding an identification bit to the current bad column byte point of the flash memory; obtaining the byte offset corresponding to the current bad column byte point according to the offset between the current bad column byte point and the previous bad column byte point; obtaining the error bit corresponding to the current bad column byte point according to the bit of the current bad column byte point; using the identification bit, the byte offset bit and the error bit to form a bad column identification data body, repeating the above steps until all the bad column byte points of the flash memory are processed, forming a bad column information table with all the obtained bad column identification data bodies, and adding a tail identification bit at the end of the bad column information table; an allocation module, configured to allocate a corresponding space address according to the space length to be occupied by the bad column information table, wherein the space address includes a variable start address and a fixed end address, and the difference between the start address and the end address is equal to the space length to be occupied by the bad column information table; A storage module is used to allocate a corresponding storage space to the bad column information table in the RAM according to the space address, and store the space address of the bad column information.
5. The device for optimizing RAM storage space according to claim 4, characterized in that: The scanning module comprises: A programming unit, used for performing programming on the flash memory; The verification unit is used to read and verify the data programmed into the flash memory, and parse out the bad column information of the flash memory based on the verification result.
6. The device for optimizing RAM storage space according to claim 5, characterized in that: The verification unit is used to parse out bad column information of the flash memory based on the verification result, including: If the number of errors of the bit positions corresponding to the current bit column is greater than or equal to the preset error bit threshold, the current bit column is determined to be a bad column; If the number of bad columns corresponding to the current byte point is greater than or equal to a preset bad column error threshold, the current byte point is determined to be a bad column byte point; The bad column information of the flash memory is parsed according to the bad column and the bad column bit.
7. An electronic device comprising: processor; as well as A memory having executable codes stored thereon, wherein when the executable codes are executed by the processor, the processor is caused to execute the method for optimizing RAM storage space as claimed in any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that: An executable code is stored, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the method for optimizing RAM storage space as described in any one of claims 1 to 3.
